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 | ATotal ← Value replaces the total with the latest value instead of adding to it, so nothing is totalled. | |
| 2Total ← Total + Value | BFOR Count ← 1 TO 5 INPUT Value Total ← Total + Value NEXT Count | |
| 3Add each number the user enters to the running total inside a FOR loop | CTotal is set to 0 inside the loop, so it is reset on every repeat and only the last value is kept. | |
| 4Output the final total once, after the loop has finished | DAdds the current Value to the running total on each repeat of the loop. | |
| 5FOR Count ← 1 TO 5 Total ← 0 INPUT Value Total ← Total + Value NEXT Count | EInitialises the running total to zero before the loop starts, so no old value is left in it. | |
| 6FOR Count ← 1 TO 5 INPUT Value Total ← Value NEXT Count | FNEXT Count OUTPUT Total |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Total ← Total + Value — A running total: set Total to 0 before the loop, then add each Value to Total on every repeat. Output Total after the loop ends.Total ← 0
WHILE Count < 5 DO
Total ← Total + ValueFOR Count ← 1 TO 5
Total ← Total + Value
NEXT CountFOR Count ← 1 TO 5
INPUT Value
Total ← Total + Value Total ← Total + Value
NEXT Count
OUTPUT Total INPUT Value
Total ← Total + Value
NEXT Count