WorksheetsCodeHS 2.11 If Statements
Total questions: 11
Worksheet time: 7mins
Which of these inputs will cause something to print to the screen?
3
23
0
-5
-1
What will be printed if this code is executed and the user enters 23?
(a)
Which conditional statement should be used for this situation:
If there is a ball present, Karel should take it. If there is no ball present, Karel should turn around.
if
if
if
if
else
none of these
Which conditional statement should be used for this situation:
If there is a ball present, Karel should take it. If the front is clear, Karel should move forward.
if
if
if
if
else
none of these
Which conditional statement should be used for this situation:
If there is a ball, Karel should take it. Then Karel should move forward.
if
if
if
if
else
none of these
Which conditional statement should be used for this situation:
If the front is clear, Karel should move. Otherwise, Karel should turn around.
if
if
if
if
else
none of these
Which conditional statement should be used for this situation:
Karel should drop a ball and then move forward until she reaches the end of the row.
if
if
if
if
else
none of these
What delimits a condition?
( )
{ }
[ ]
< >
What delimits a block?
( )
{ }
[ ]
< >
What kind of control structure is an if statement?
sequence
selection
iteration
structure
Which of these were today's learning targets?
I can explain the purpose of if statements
I can create my own if statements to select which code is executed in my programs
I can use the selection control structure
I can remember learning targets without writing them down with 100% accuracy
I can use nesting to create complex if statements
