Font size
WorksheetsIf Then Coding Statements in Coding
Total questions: 20
Worksheet time: 14mins
If Yuri realizes he has a test tomorrow, he should
What is a conditional statement?
a statement that runs no matter what is true
a statement that only runs when certain criteria are met
a statement that’s only found in the code for games
a statement that’s only found in one coding language
Conditional statements tell computers to check if a condition is ________.
left or right
big or small
true or false
tall or short
What is the name for the part of the program that could be carried out if the if condition turns out to be false?
the "else"
the “actually”
the “otherwise”
the "instead"
What will a computer do if the if condition turns out to be true?
move on to the else
carry out a specific action
move on to the else if
check again to see if the condition is false
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”?
else if
else after
instead
otherwise
If your conditional statement has an if, an else if and an else, how many different outcomes can happen?
0
1
2
3
What will a program do if both the if and else if conditions turn out to be false?
go back and check the if condition again
check the else if condition again
move on to the else
delete the if condition
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?
your grandma telling your dad that you didn’t help
you telling your dad that you didn’t help
you buying ice cream
you helping your grandma fix her television
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.
If the shirt is red, keep it. Else, give the shirt to my brother.
If the shirt is red, give it to my brother. Else, keep the shirt.
If the shirt is red, give it to my brother. Else, also give the shirt to my brother.
If the shirt is red, keep it. Else, also keep the shirt.
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.
It will summon a dancing alligator.
It will summon a singing parrot
It will summon a poisonous spider.
Pieces of code that only run "under certain conditions":
conditional statements
control flow statments
syntax
variables
