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 | |
|---|---|---|
| 1CONSTANT VATRate ← 0.2 | ACONSTANT Pi ← 3.142 | |
| 2DECLARE Score : INTEGER | BA fixed value that is set once and never changes while the program runs | |
| 3Pi never changes while the program runs, so store it as a constant | CThe VAT rate is fixed for the whole program, so it should be a constant (CONSTANT VATRate ← 0.2), not a variable that could be changed. | |
| 4The user's answer is typed in and can be different each time, so store it in a variable | DDECLARE Answer : STRING INPUT Answer | |
| 5DECLARE VATRate : REAL VATRate ← 0.2 | EA variable for a value that can change as the program runs, such as a player's score | |
| 6CONSTANT Score ← 0 Score ← Score + 10 | FA score changes as the program runs, so it must be a variable (DECLARE Score : INTEGER), because a constant cannot be updated. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
CONSTANT — Use CONSTANT for a value fixed while the program runs, e.g. VAT rate or pi. Use a variable (DECLARE) for a value that changes or is input, e.g. score or answer.CONSTANT VATRate ← 0.2DECLARE Score : INTEGERCONSTANT Pi ← 3.14DECLARE Answer : STRING
INPUT AnswerCONSTANT VATRate ← 0.2
Total ← Price * (1 + VATRate)