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 | |
|---|---|---|
| 1Marks[3] | AIndex 6 does not exist because the array has a fixed length and its indexes only run from 1 to 5. | |
| 2DECLARE Marks : ARRAY[1:5] OF INTEGER | BMarks[1], Marks[2], Marks[3] | |
| 3An element is one stored value, and it is reached by giving its index | CThe element at index 3 of the array Marks; the index is the position number in square brackets | |
| 4An array is better than separate variables because one name holds many values that are reached by index | DMarks[2] ← 75 | |
| 5Marks(3) ← 60 | ERound brackets are used for the index. The index must go in square brackets, as in Marks[3]. | |
| 6Marks[6] ← 60 (array declared as ARRAY[1:5]) | FCreates one array of 5 elements with consecutive indexes 1, 2, 3, 4, 5, each holding an integer |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ARRAY — A fixed-length structure of elements; each element holds one value and is reached by its index, the position number in square brackets, such as Marks[3].DECLARE Marks : ARRAY[1:5] OF INTEGERDECLARE Marks : ARRAY[1:5] OF INTEGER
Marks[5] ← 90Marks[1] ← 60
Marks[2] ← 71
Marks[3] ← 84DECLARE Scores : ARRAY[1:3] OF INTEGER
Scores[2] ← 14Total ← Marks[1] + Marks[2]