wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

If Then Coding Statements in Coding

Total questions: 20

Worksheet time: 14mins

Name
Class
Date
1.

If Yuri realizes he has a test tomorrow, he should

4 lines
2.

What is a conditional statement?

a)

a statement that runs no matter what is true

b)

a statement that only runs when certain criteria are met

c)

a statement that’s only found in the code for games

d)

a statement that’s only found in one coding language

3.

Conditional statements tell computers to check if a condition is ________.

a)

left or right

b)

big or small

c)

true or false

d)

tall or short

4.

What is the name for the part of the program that could be carried out if the if condition turns out to be false?

a)

the "else"

b)

the “actually”

c)

the “otherwise”

d)

the "instead"

5.

What will a computer do if the if condition turns out to be true?

a)

move on to the else

b)

carry out a specific action

c)

move on to the else if

d)

check again to see if the condition is false

6.

If the if condition turns out to be false, what is the name of the condition that the program could check before moving onto the “else”?

a)

else if

b)

else after

c)

instead

d)

otherwise

7.

If your conditional statement has an if, an else if and an else, how many different outcomes can happen?

a)

0

b)

1

c)

2

d)

3

8.

What will a program do if both the if and else if conditions turn out to be false?

a)

go back and check the if condition again

b)

check the else if condition again

c)

move on to the else

d)

delete the if condition

9.

Your grandma says, “If you help me fix my television, I’ll buy you some ice cream. Or else, I’ll tell your dad you didn’t help.” What is the condition that must be true in order for your grandma to buy you ice cream?

a)

your grandma telling your dad that you didn’t help

b)

you telling your dad that you didn’t help

c)

you buying ice cream

d)

you helping your grandma fix her television

10.

You’re organizing your closet. You decide that if you pick up a shirt and it’s red, you’ll keep it. If it’s not, you’ll give the shirt to your brother. Choose the conditional statement that you could write for this situation.

a)

If the shirt is red, keep it. Else, give the shirt to my brother.

b)

If the shirt is red, give it to my brother. Else, keep the shirt.

c)

If the shirt is red, give it to my brother. Else, also give the shirt to my brother.

d)

If the shirt is red, keep it. Else, also keep the shirt.

11.

Read the following conditional for a game, and choose what the program will do if your level equals 5.


If level equals 3, summon a dancing alligator.

Else if level equals 5, summon a singing parrot.

Else, summon a poisonous spider.

a)

It will summon a dancing alligator.

b)

It will summon a singing parrot

c)

It will summon a poisonous spider.

12.

Pieces of code that only run "under certain conditions":

a)

conditional statements

b)

control flow statments

c)

syntax

d)

variables

13.
What is an error in a program that prevents the program from running as expected?
a)
Algorithm
b)
Program
c)
Bug
d)
Code
14.
What is finding and fixing errors in programs?
a)
Debugging
b)
Program
c)
Bug
d)
Code
15.
What are statements that only run under certain conditions?
a)
Code
b)
Loop
c)
Conditionals
d)
Binary
16.
If I say the word "Algorithm" I am talking about what?
a)
When we all go to a store called Rithim.
b)
Algae that can DANCE!!!
c)
A new dance move.
d)
A list of steps you follow to finish a task.
17.
Code is...
a)
when it's not warm.
b)
the dog from Garfield.
c)
a song or poem dedicated to someone.
d)
specific instructions in a computer program.
18.
Statements that can only run under certain conditions or situations such as: if the seat is taken, then move to the next available seat. 
a)
conditionals (if/then statements)
b)
variable
c)
abstractions
d)
binary
19.
The action of doing something over and over and over and over and over and over and over and over and over and... oh yeah, over again.
a)
Deja Vu 
b)
Loop
c)
Repeating
d)
Being annoying
20.
A program is 
a)
a show on TV.
b)
an algorithm that has been coded into something that can be run by a machine.
c)
a professional graham cracker.
d)
part of a smore.