Form 8: Combining Loops and Conditionals
Practice combining loops and conditional statements to create more complex and dynamic logical structures.
Questions
-
MultiChoice
What does combining loops and conditionals allow an algorithm to do?
-
MultiChoice
'REPEAT 10 TIMES: [IF sensor detects obstacle THEN turn left ELSE move forward]'. What happens each step?
-
WordsBox
Combining loops and conditionals enables ____ decision-making during ____
-
MultiChoice
In a loop checking 10 numbers: 'IF number is even THEN count = count + 1'. What is counted?
-
MultiChoice
'REPEAT UNTIL energy == 0: [Move forward; IF battery low THEN charge]'. What does robot do if battery low?
-
MultiChoice
Which structure checks every item in a list and picks items meeting a criteria?
-
WordsBox
Inside a ____ an IF statement can test different ____ on each iteration.
-
MultiChoice
'REPEAT 5 TIMES: [IF coin == heads THEN win = win + 1]'. How many coins are flipped?
-
MultiChoice
Why put an IF statement inside a loop?
-
MultiChoice
'REPEAT 8 TIMES: [IF step is muddy THEN jump ELSE walk]'. What happens on a dry step?
-
MultiChoice
What is nested code logic?
-
MultiChoice
In a grid game, repeating 'IF space empty THEN move forward' allows character to: