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 3 OUTPUT Count NEXT Count | AThe loop body is not indented. OUTPUT Count should be moved in by four spaces. | |
| 2IF Score > 50 THEN OUTPUT "Pass" ENDIF | BWHILE N < 5 DO IF N = 3 THEN OUTPUT N ENDIF N ← N + 1 ENDWHILE | |
| 3Nested statements keep indenting: an IF inside a loop is four spaces in, and its THEN part goes further in | CTHEN is indented by four spaces. It should be indented by only two spaces. | |
| 4ELSE lines up with THEN at two spaces, and the statements under each are indented four spaces | DThe statement inside the loop body is indented by four spaces | |
| 5FOR Count ← 1 TO 3 OUTPUT Count NEXT Count | ETHEN is indented by only two spaces under IF, and the statement inside is indented by four | |
| 6IF Age >= 18 THEN OUTPUT "Adult" ENDIF | FIF Age >= 18 THEN OUTPUT "Adult" ELSE OUTPUT "Child" ENDIF |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
indentation — Statements inside a loop or IF are moved in by four spaces, but THEN and ELSE are moved in by only two. Nested statements keep indenting, which makes the structure easy to read.FOR Count ← 1 TO 5
OUTPUT Count
NEXT Count ELSE
OUTPUT "Fail"
ENDIFWHILE Total < 100 DO
Total ← Total + 10
ENDWHILEFOR Row ← 1 TO 3
FOR Col ← 1 TO 3
OUTPUT Row * ColREPEAT
INPUT Guess
UNTIL Guess = 7