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 | |
|---|---|---|
| 1OUTPUT StudentNames[1] | ABest ← Scores[3] | |
| 2Total ← Marks[1] + Marks[2] | BCopy ← Marks[2] OUTPUT Marks[2] | |
| 3Copying one element into a variable: the value is read from the array and stored in the variable | CReads the values in elements 1 and 2 of Marks, adds them and stores the result in Total | |
| 4Reading an element does not change it: the element keeps its value after being used | DThe assignment is the wrong way round. This writes Total into the array element instead of reading the element. To read it, write Total ← Marks[1]. | |
| 5OUTPUT StudentNames(1) | ERound brackets are used instead of square brackets. An array element must be read as StudentNames[1]. | |
| 6Marks[1] ← Total | FDisplays the value stored in element 1 of the StudentNames array |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
OUTPUT StudentNames[1] — Reading an element: Name[index] in OUTPUT or an expression gives the value stored in that element. Reading only uses the value, so the element stays unchanged.OUTPUT StudentNames[1]OUTPUT StudentNames[1]Total ← Marks[1] + Marks[2]Score ← Marks[3]Best ← Marks[2]
OUTPUT Best
OUTPUT Marks[2]