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 | AEND IF | |
| 2ELSE | BIF-THEN-ELSE block | |
| 3A keyword that closes an IF-THEN-ELSE block | CThe condition line is missing THEN after the condition | |
| 4A structure that runs different instructions depending on a condition | DIntroduces the instructions run when the condition is false | |
| 5IF total > 100 DISPLAY "Over" ELSE DISPLAY "OK" ENDIF | EStarts a selection block and introduces the true branch | |
| 6IF stock = 0 DISPLAY "Out" ELSE DISPLAY "In" END IF | FThe closing keyword should be written as END IF, not ENDIF |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF-THEN-ELSE — A selection structure that runs one set of instructions if a condition is true, and a different set if it is falseIF x > 0 THENIF x > 0 THEN
DISPLAY "Positive"
ELSEIF p THEN
DISPLAY p
END IFIF a = b THENIF valid THEN
DISPLAY "OK"
ELSE