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 | |
|---|---|---|
| 1DECLARE Marks : ARRAY[1:30] OF INTEGER | AAn array can only have one data type. You cannot list STRING and INTEGER together. Use two arrays, one for each type. | |
| 2DECLARE Names : ARRAY[1:5] OF STRING | BDECLARE Name : ARRAY[1:20] OF STRING DECLARE Age : ARRAY[1:20] OF INTEGER | |
| 3A table holds names (STRING) and ages (INTEGER), so you use two separate arrays of the same length, one for each data type. | CCreates an array with exactly 30 elements, and every element must be an INTEGER. The size is fixed once declared. | |
| 4The size of an array is set when it is declared. The upper bound 10 means it holds exactly 10 elements and cannot grow. | DDECLARE Scores : ARRAY[1:10] OF INTEGER | |
| 5DECLARE Data : ARRAY[1:3] OF STRING, INTEGER | EMarks is an ARRAY OF INTEGER, so a STRING cannot be stored in it. The value must be an INTEGER such as 0. | |
| 6Marks[1] <- "Absent" | FCreates an array that holds exactly 5 STRING values. It cannot store an INTEGER in any element. |
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] OF INTEGER — An array has a fixed size set when it is declared, and every element must be the same data type, so STRING and INTEGER cannot be mixed in one array.DECLARE Scores : ARRAY[1:30] OF INTEGER// Space for exactly 25 names
DECLARE Names : ARRAY[1:25] OF STRINGDECLARE Names : ARRAY[1:30] OF STRING
DECLARE Marks : ARRAY[1:30] OF INTEGERDECLARE Prices : ARRAY[1:10] OF REAL// 12 temperatures such as 18.5 and 21.0
DECLARE Temps : ARRAY[1:12] OF REAL