Question 1
2 marksWrite a pseudocode statement to declare a one-dimensional array, CarRegs, that can store the registration numbers of 50 cars. The first index is 1.
Model answer
DECLARE CarRegs : ARRAY[1:50] OF STRING
Explanation
An array declaration gives the identifier, the lower and upper bounds of the index in square brackets, and the data type of every element. Registration numbers such as AB12 CDE mix letters and digits, so STRING is needed.
Mark scheme
-
1 mark
MP1 DECLARE CarRegs : ARRAY[1:50]
-
1 mark
MP2 OF STRING
Registration numbers contain letters, so do not accept INTEGER or CHAR.