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 | |
|---|---|---|
| 1Index ← 3 OUTPUT Marks[Index] | AStores 50 in whichever element Index currently points to | |
| 2Marks[Index] ← 50 | BIndex ← 2 OUTPUT Marks[Index] Index ← 5 OUTPUT Marks[Index] | |
| 3Changing the value of the index variable makes the same statement reach a different element | CIndex is in quotation marks, so it is treated as text, not as the variable holding 4. It should be Marks[Index]. | |
| 4The variable used as an index must be an INTEGER | DDisplays the value stored in element 3 of Marks, because Index currently holds 3 | |
| 5DECLARE Index : STRING Index ← 3 OUTPUT Marks[Index] | EDECLARE Index : INTEGER | |
| 6Index ← 4 OUTPUT Marks["Index"] | FIndex is declared as STRING, but a variable used as an array index must be an INTEGER whole number. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Marks[Index] — A variable inside the brackets picks the element whose index matches its value. Change Index (an INTEGER) and the same statement reaches a different element of Marks.Index ← 3
OUTPUT Marks[Index]DECLARE Index : INTEGER
Index ← 3
Marks[Index] ← 85Index ← 3
Index ← Index + 1
OUTPUT Marks[Index]Index ← 3
Marks[Index] ← 85Index ← 5
OUTPUT Marks[Index]