Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1REPEAT Add 1 cup of water UNTIL bucket is full | AThe stopping condition is missing after UNTIL, so the computer doesn't know when to stop repeating. | |
| 2UNTIL password is correct | BREPEAT Eat one bite UNTIL plate is empty | |
| 3Use REPEAT UNTIL when you don't know in advance how many times the steps must run | CKeep adding water again and again until the bucket is full, even if we don't know how many cups it takes | |
| 4A loop must change something inside it so the stopping condition can become true | DREPEAT Roll the dice UNTIL the dice shows 6 | |
| 5REPEAT Walk 1 step UNTIL I have wings | EThe stopping condition: the loop ends when this becomes true | |
| 6REPEAT Clap your hands UNTIL | FThe condition can never become true, because walking will never give you wings. The loop never stops. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
REPEAT ... UNTIL — A loop that keeps repeating its steps until a condition becomes true. Use it when you don't know how many times. Make sure the condition can happen, or the loop never stops.REPEAT
Kick the ball
UNTIL the goal is scoredREPEAT
Stir the soup
UNTIL the soup is hotREPEAT
Add 1 to steps
UNTIL steps = 10REPEAT
Add 1 to score
UNTIL score = 10REPEAT
Add 1 to count
UNTIL count = 3