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 | |
|---|---|---|
| 1IF Score >= 50 THEN OUTPUT "Pass" ENDIF | AOutputs Pass only when Score is 50 or more; if Score is lower, the OUTPUT line is skipped | |
| 2ENDIF | BThe IF has no ENDIF. Every IF must be closed with ENDIF after the lines that depend on the condition. | |
| 3The lines between THEN and ENDIF are indented so it is clear which lines depend on the condition | CCloses the IF statement and marks where the conditional lines end | |
| 4When the condition is FALSE, the program skips the indented lines and carries on after ENDIF | DCount ← 0 IF Count > 5 THEN OUTPUT "Big" ENDIF OUTPUT "Done" | |
| 5IF Temp > 30 THEN OUTPUT "Hot" | EIF Age >= 18 THEN OUTPUT "Adult" ENDIF | |
| 6IF Score > 90 THEN OUTPUT "Top mark" ENDIF | FThe line between THEN and ENDIF is not indented, so it is not clear that it depends on the condition. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF condition THEN ... ENDIF — Runs the indented lines between THEN and ENDIF only when the condition is TRUE. If it is FALSE, those lines are skipped. Every IF must be closed with its own ENDIF.IF Age >= 16 THEN
OUTPUT "Adult"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Temp < 10 THEN
OUTPUT "Cold"
ENDIFIF Total > 100 THEN
Discount ← 10
ENDIFIF Count > 0 THEN
OUTPUT Total / Count
ENDIF