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 5 TIMES IF tired THEN rest | ANothing is indented, so it is unclear that the IF is inside the REPEAT. Indent the IF and the step under it. | |
| 2REPEAT UNTIL door is open IF door is locked THEN use key | BThe IF is indented inside the REPEAT, so the check happens on every one of the 5 repetitions | |
| 3Each pass through the loop can take a different path because the IF is checked every time | CREPEAT UNTIL bag is full IF fruit is ripe THEN pick fruit | |
| 4A loop that stops when a decision is met | DThe loop keeps going until the door opens, and each pass decides whether the key is needed | |
| 5REPEAT 3 TIMES IF ball is red THEN throw ball | EThe REPEAT is inside the IF, so the hungry check happens only once. The IF should be inside the REPEAT to be checked each time. | |
| 6IF dog is hungry THEN REPEAT 3 TIMES feed dog | FREPEAT 4 TIMES IF light is red THEN stop ELSE walk |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF inside REPEAT — An IF placed inside a REPEAT is checked again on every repetition, so each pass through the loop can take a different path.REPEAT 5 TIMES
IF light is red THEN
stopREPEAT 7 TIMES
IF door is open THEN
walk throughREPEAT UNTIL bag is full
IF fruit is an apple THEN
add it to bagREPEAT UNTIL seat found
IF seat is free THEN sit down
ELSE walk onREPEAT 10 TIMES
IF score > 5 THEN
add 1 to points