0984
Arrays
Programming · 4 question types
Exam Frequency Analysis
Past paper frequency (2018 to 2024)
This topic accounts for approximately 5% of your exam marks.
stable
Rare
Stable5%
1D array manipulation with FOR loops appears regularly in Paper 2. 4 to 6 marks.
An array is a named, ordered collection of values of the same data type, stored as a single variable. Each value is accessed using an .
Three things make arrays different from ordinary variables:
- One name, many values. Instead of
Score1,Score2,Score3, ...,Score30, you can use a single arrayScoreswith 30 elements. - Same data type for every . An array of integers can only hold integers; an array of strings can only hold strings.
- Fixed size. The size is set when the array is declared and (in CIE pseudocode) does not change.
Arrays are essential because programs almost always need to handle many values at once: a class of students, a row of pixels in an image, a list of stock prices, a sequence of network packets.