Arrays have a fixed length and one data type
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.
Understanding Arrays have a fixed length and one data type in IGCSE Computer Science Paper 2
What it does: One array cannot mix data types, so mixed data is split into parallel arrays, each with a single type and the same size. The bounds 1:10 fix the number of elements at declaration, so the array always holds 10 elements. The size is set when the array is declared. To store more items, you must declare a bigger array. "Pass" is a STRING, but Scores holds INTEGER values only. 72 is an INTEGER so it is allowed. OF STRING makes every element a STRING, and the bounds 1:5 fix the length at 5 elements.
Common mistakes: M is declared as an array of REAL, so every element must be a number. A STRING such as "absent" cannot be stored in it. The line should be M[2] ← 65. N is an array of STRING, so every element must be text. The number 16 is a different data type and cannot be mixed in. The line should be N[2] ← "Liam".
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 439–448) and word search (Modules 439–458).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
ARRAY[1:30] OF INTEGERFill in the Blanks
Spot the Error
Student with a class code? Join your class →