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 | |
|---|---|---|
| 1Score ← 5 | AUses the assignment arrow inside a condition. A condition must test equality with =, so it should be IF Score = 5 THEN. | |
| 2IF Score = 5 THEN | BStores the value 5 in the variable Score (assignment) | |
| 3Use <> to test that two values are not equal | CIF Score <> 5 THEN | |
| 4Assignment changes the stored value of a variable, so Lives goes down by one | DLives ← Lives - 1 | |
| 5Score = 5 | ETests whether Score is equal to 5, giving TRUE or FALSE | |
| 6IF Score ← 5 THEN | FUses = to store a value. In 0478 pseudocode = is only for comparison, so assignment must be written Score ← 5. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Score ← 5 — ← stores a value in a variable, so Score ← 5 saves 5 in Score. = only tests if two values are equal, as in IF Score = 5, and gives TRUE or FALSE. <> tests not equal.Score ← 5IF Score = 5 THENIF Lives <> 0 THENCount ← 0
Count ← Count + 1REPEAT
INPUT Guess
UNTIL Guess = Secret