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 greater than 50; otherwise nothing happens | |
| 2ENDIF | BIF Age >= 16 THEN OUTPUT "Can apply" ENDIF | |
| 3The statements between THEN and ENDIF run only when the condition is TRUE | CThe ENDIF is missing, so the IF statement is never closed and it is unclear where the IF ends | |
| 4Every IF statement must be closed with its own ENDIF | DIF Temp < 0 THEN OUTPUT "Ice" ENDIF | |
| 5IF Score > 50 THEN OUTPUT "Pass" | ETHEN is missing after the condition, so the IF line is incomplete | |
| 6IF Score > 50 OUTPUT "Pass" ENDIF | FCloses an IF statement and marks where the statements that depend on the condition end |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF ... THEN ... ENDIF — Runs the statements between THEN and ENDIF only when the condition is TRUE. If it is FALSE, they are skipped. Every IF must be closed with ENDIF, e.g. IF Score > 50 THEN OUTPUT "Pass" ENDIF.IF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIFIF Score > 50 THEN
OUTPUT "Pass"
ENDIF