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 ← 0 is inside the loop, so the total is reset to zero on every repeat and only the last number is kept. | |
| 2Total ← Total + Number | BSets the running total to zero before the loop starts | |
| 3Declare an integer variable to hold the running total | CTotal ← Number replaces the total instead of adding to it, so the earlier values are lost. | |
| 4Total every element in an array called Marks with 5 items | DFOR Index ← 1 TO 5 Total ← Total + Marks[Index] NEXT Index | |
| 5FOR Count ← 1 TO 5 INPUT Number Total ← 0 Total ← Total + Number NEXT Count | EAdds the new Number to the running total each time the loop repeats | |
| 6Total ← 0 FOR Count ← 1 TO 5 INPUT Number Total ← Number NEXT Count | FDECLARE Total : INTEGER |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Total ← Total + Number — Adds each new Number to the running Total every time the loop repeats. Set Total ← 0 before the loop so the total starts from zero.DECLARE Total : INTEGERDECLARE Total : INTEGER
Total ← 0
FOR Count ← 1 TO 5FOR Count ← 1 TO 5
INPUT Number
Total ← Total + NumberFOR Index ← 1 TO 10
Total ← Total + Scores[Index]
NEXT IndexFOR Count ← 1 TO 5
Total ← Total + Number
NEXT Count