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 | |
|---|---|---|
| 1FOR Count ← 1 TO 5 OUTPUT Count NEXT Count | AThe loop body is not indented. OUTPUT Count should start with 4 spaces to show it belongs to the FOR loop. This is a presentation error. | |
| 2FOR Row ← 1 TO 3 FOR Col ← 1 TO 3 OUTPUT Row * Col NEXT Col NEXT Row | BThe OUTPUT line is indented by 4 spaces to show it is inside the FOR loop and repeats each time | |
| 3The body of a WHILE loop is indented by 4 spaces, and ENDWHILE lines up with WHILE | CREPEAT INPUT Score OUTPUT "Score is ", Score UNTIL Score > 50 | |
| 4Inside a loop, a statement that wraps onto a second line has its continuation line indented by 2 more spaces | DNested loops: the inner FOR is 4 spaces in and its body is 8 spaces in, because each nested loop adds 4 more spaces | |
| 5FOR Count ← 1 TO 5 OUTPUT Count NEXT Count | EWHILE Total < 100 DO Total ← Total + 10 ENDWHILE | |
| 6FOR Row ← 1 TO 3 FOR Col ← 1 TO 3 OUTPUT Row * Col NEXT Col NEXT Row | FThe body of the inner loop is only indented by 4 spaces, level with the inner FOR. It needs 8 spaces because each nested loop adds 4 more. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
4 spaces — Indent every statement inside a FOR, WHILE or REPEAT loop by 4 spaces. Nested loops add 4 more; wrapped continuation lines use 2. An unindented loop body is a presentation error.FOR Count ← 1 TO 5
OUTPUT Count
NEXT CountWHILE Total < 100 DO
Total ← Total + 5
ENDWHILEFOR Row ← 1 TO 3
FOR Col ← 1 TO 3
OUTPUT Row * ColOUTPUT "Your total score for the quiz is ",
TotalScore, " points"REPEAT
INPUT Guess
UNTIL Guess = 7