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 | AIF Mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF | |
| 2OUTPUT Total | BCopying code is not a description. The answer must explain in words what the line does with the data. | |
| 3Describe what the loop repeats: for each of the 10 numbers, the next value is input and added to the total. | CToo vague: it does not say what is repeated or what happens to the data, so it gains no marks. | |
| 4Describe the decision and its outcomes: if the mark is 50 or more, Pass is output, otherwise Fail is output. | DFOR Count ← 1 TO 10 INPUT Num Total ← Total + Num NEXT Count | |
| 5The program loops and does stuff with the numbers, then it finishes. | EInitialising: the variable Total is set to zero before the loop so it can start adding up values. | |
| 6Total ← Total + Num is the process, so the answer just copies the code line. | FFinal output: after the loop has finished, the value stored in Total is displayed to the user. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Describe the processes — State, in order and in plain words, what each part of the algorithm does with the data: set up variables, what the loop repeats, what the decision does, then the output.Total ← 0
Count ← 0
FOR Index ← 1 TO 10FOR Index ← 1 TO 10
Total ← Total + Mark[Index]
NEXT IndexIF Mark[Index] > Highest THEN
Highest ← Mark[Index]
ENDIFAverage ← Total / 10
OUTPUT AverageWHILE Count < 5 DO
Count ← Count + 1
ENDWHILE