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 | |
|---|---|---|
| 1StudentNames[1] ← "Ali" | AStores the value "Ali" in the element at index 1 of the StudentNames array | |
| 2StudentNames[n + 1] ← StudentNames[n] | BIndex 0 is outside the array's bounds. The lower bound is 1, so the index must be between 1 and 30. | |
| 3To change one element of an array, write the array name, one index in square brackets, then ← and the new value | CStudentNames[3] ← "Mia" | |
| 4To read an element, use the array name and one index in square brackets, for example to output it | DOUTPUT StudentNames[2] | |
| 5StudentNames[0] ← "Ali" (array declared as ARRAY[1:30]) | ECopies the value at index n into the next element, whose index is n + 1 | |
| 6StudentNames(1) ← "Ali" | FRound brackets are used instead of square brackets. The index must be written in square brackets. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
StudentNames[1] — Reads or changes one array element: the array name, then one index in square brackets. The index must be between the array's lower and upper bound. StudentNames[1] ← "Ali" stores a value.StudentNames[1] ← "Ali"DECLARE StudentNames : ARRAY[1:5] OF STRING
StudentNames[5] ← "Zoe"StudentNames[n + 1] ← StudentNames[n]StudentNames[1] ← "Ali"OUTPUT StudentNames[2]