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 Mark >= 50 THEN OUTPUT "Pass" ENDIF | ACloses the IF block, marking where the statements that depend on the condition end. | |
| 2ENDIF | BENDIF is missing, so the IF block is never closed. Add ENDIF on the last line. | |
| 3THEN goes on the same line as the condition and the statements to run go on the following indented lines. | CIF Age >= 18 THEN OUTPUT "Adult" ENDIF | |
| 4An IF with no ELSE does nothing when the condition is FALSE and the program carries on after ENDIF. | DOutputs Pass only when Mark is 50 or more; otherwise nothing is output. | |
| 5IF Temp > 30 OUTPUT "Hot" ENDIF | ETHEN is missing after the condition. It should be IF Temp > 30 THEN. | |
| 6IF Lives = 0 THEN OUTPUT "Game over" | FIF Score > 100 THEN Score <- 100 ENDIF |
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 statements between THEN and ENDIF only when the condition is TRUE. If the condition is FALSE, they are skipped. This form has no ELSE part.IF Age >= 18 THEN
OUTPUT "Adult"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Temp < 10 THEN
OUTPUT "Cold"
ENDIFIF Age >= 18 THEN
OUTPUT "Can vote"
ENDIFIF Lives = 0 THEN
OUTPUT "Game over"
ENDIF