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 | |
|---|---|---|
| 1ARRAY[1:30] | ADECLARE Marks : ARRAY[1:25] OF INTEGER | |
| 2ARRAY[0:9] | BThe bounds are written the wrong way round. The lower bound must come first and the upper bound second, as l:u, so it should be ARRAY[1:30]. | |
| 3The lower bound is the index of the first element, written before the colon | CThe two bounds are separated by a comma instead of a colon. A 1D array needs l:u, so it should be ARRAY[1:20]. | |
| 4The upper bound is the index of the last element, written after the colon | DAn array whose first element has index 1 (lower bound) and whose last element has index 30 (upper bound) | |
| 5DECLARE Scores : ARRAY[30:1] OF INTEGER | EThe lower bound is 0 and the upper bound is 9, so the indexes run 0, 1, 2 ... 9 | |
| 6DECLARE Ages : ARRAY[1,20] OF INTEGER | FDECLARE Names : ARRAY[1:40] OF STRING |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ARRAY[1:30] — In ARRAY[l:u], l is the lower bound (index of the first element) and u is the upper bound (index of the last). Here the lower bound is 1 and the upper bound is 30.DECLARE Scores : ARRAY[1:30] OF INTEGER
// 30 elements, first index is 1DECLARE Names : ARRAY[1:30] OF STRING
// the last element has index 30DECLARE Temp : ARRAY[0:6] OF REAL
// 7 elements, first index is zeroDECLARE Marks : ARRAY[1:30] OF INTEGERDECLARE Scores : ARRAY[1:30] OF INTEGER
FOR Index ← 1 TO 30
NEXT Index