Arrays and Records
Aligned to the AQA 8525 specification
- Topic
- Programming
- Level
- Intermediate
- Reading time
- 8 min
- Published
- 8 June 2026
- Updated
- 1 July 2026
On this page
Key takeaways
- An array stores multiple values of the same data type under one identifier, with each element accessed by an integer index.
- AQA pseudocode uses zero-based indexing, so an array with n elements has valid indices 0 to n − 1; accessing an index outside this range is an out-of-bounds error.
- A record groups related values that may have different data types under one identifier, each accessed by field name rather than index.
- Swapping two array elements needs a temporary variable, because assigning one element to the other first overwrites and permanently loses the original value.
- A 2D array is a grid accessed by two indices as array[row][column], used whenever data forms a natural grid like a seating plan or game board.
Studying this for an exam?
Generate a personalised learning path for this subject. Free to get started.
Key terms
- Array
- A data structure that stores multiple values of the same data type under a single identifier, each accessed by its index.
- Index
- An integer indicating the position of an element in an array; AQA pseudocode counts from 0.
- 1D array
- A one-dimensional array: a flat, ordered list of values accessed by a single index.
- 2D array
- A two-dimensional array: a grid of values organised into rows and columns, accessed by two indices as array[row][column].
- Record
- A data structure that groups related values which may have different data types under one identifier, each accessed by field name.
- Field
- A single named value within a record, accessed by name rather than by index.
- Traversal
- Visiting every element in an array in sequence, typically using a FOR loop where the loop variable serves as the index.
- Accumulator
- A variable initialised to 0 before a loop and incremented each iteration to build up a running total.
- Linear search
- An algorithm that finds the index of a target value by checking each element in turn, using a found flag to handle absent values.
- Out-of-bounds error
- An error caused by accessing an index outside the valid range 0 to n − 1 of an n-element array.
Frequently asked questions
An array holds many values of the same data type accessed by integer index, while a record groups fields that may be different data types, each accessed by field name. An array represents a collection of similar items; a record represents one entity with multiple attributes.
AQA pseudocode uses zero-based indexing, so the first element is at index 0 and a 5-element array uses indices 0 to 4. Writing FOR i ← 1 TO 5 misses index 0 and tries to access index 5, which does not exist.
Without a temporary variable, the first assignment scores[0] ← scores[1] overwrites the original value of scores[0] before it has been saved, so that value is permanently lost. Saving to temp first preserves it for the second assignment.
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
Selection and Iteration
Subroutines: Procedures and Functions
Related lessons
6 min
8 min
9 min