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 it is raining THEN | AIF, THEN and END IF must be written in capital letters so they stand out from the rest of the steps. | |
| 2END IF | BChecks the condition 'it is raining'. The indented action below runs only if it is true. | |
| 3The action is indented so it is clearly part of the IF block and runs only when the condition is true. | CIF door is open THEN walk through END IF say hello | |
| 4If the condition is false, the action is skipped and the program carries on after END IF. | DThe action is not indented and there is no END IF to close the block. | |
| 5if battery is low then plug in charger end if | EIF score > 10 THEN show "Well done!" END IF | |
| 6IF lights are off THEN turn on the lights | FMarks the end of the IF block so the computer knows where the branching stops. |
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 action END IF — Runs the indented action only when the condition is true. If the condition is false, the action is skipped. Write IF and THEN in capitals, indent the action, and finish with END IF.IF it is raining THEN
take an umbrella
END IFIF it is raining THEN
take an umbrella
END IFIF it is dark THEN
turn on the lamp
END IFIF score > 10 THEN
SHOW "You win"
END IFIF door = locked THEN
use the key
END IF