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 | |
|---|---|---|
| 1Total ← 0 | AScore ← 5 Score ← 8 | |
| 2Total ← Total + Number | BStores the value 0 in the variable Total, so the total starts at zero | |
| 3Assigning a new value to a variable replaces the value it held before | CThe variable and the value are the wrong way round. The variable must be on the left of the arrow and the value on the right, so it should be Total ← 0. | |
| 4The arrow stores the value on its right in the variable on its left | DIn Cambridge pseudocode = is used to compare values, not to store them. To set Total to 0 you must write Total ← 0. | |
| 50 ← Total | EAdds Number to the current value of Total and stores the answer back in Total | |
| 6Total = 0 | FCount ← 10 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Total ← 0 — The ← arrow stores the value on its right in the variable on its left. Total ← 0 sets Total to 0. A new assignment replaces the old value. It is not the same as = used to compare.Total ← 0Total ← Total + NumberTotal ← 10
Total ← Total + 5
OUTPUT TotalIF Total = 0 THEN
OUTPUT "Empty"
ENDIFDECLARE Total : INTEGER
Total ← 0