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 | |
|---|---|---|
| 1counter ← 0 | AAdds 1 to the counter each time the loop repeats, so it counts how many times something happened | |
| 2counter ← counter + 1 | BSets the counter to 0 before the loop starts so counting begins from zero | |
| 3Stop the loop when the counter reaches 5 | CREPEAT UNTIL counter = 5 | |
| 4Start counting from zero before the loop begins | DThe counter is set to 0 inside the loop, so it never goes up and the loop never stops. It should be counter ← counter + 1. | |
| 5REPEAT UNTIL counter = 4 counter ← 0 | EThe counter was never set to 0 before the loop. Add counter ← 0 before the loop so it starts from a known number. | |
| 6REPEAT UNTIL counter = 3 counter ← counter + 1 | Fcounter ← 0 REPEAT UNTIL counter = 3 counter ← counter + 1 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
counter ← counter + 1 — A counter is a variable that goes up by 1 each time a loop repeats, so it counts how many times something happened. Set it to 0 before the loop starts.counter ← 0
REPEAT UNTIL counter = 5
counter ← counter + 1claps ← 0
REPEAT UNTIL claps = 10
claps ← claps + 1counter ← 0
REPEAT UNTIL counter = 5
counter ← counter + 1jumps ← 0
REPEAT UNTIL jumps = 8
jumps ← jumps + 1counter ← 0
REPEAT UNTIL counter = 5
counter ← counter + 1