← IGCSE Computer Science Paper 2

Meaningful identifiers for arrays

An array name that says what its elements hold, like StudentNames not A. It must never be a keyword such as INPUT or FOR, and upper or lower case makes no difference.

Understanding Meaningful identifiers for arrays in IGCSE Computer Science Paper 2

What it does: Both lines use the same array even though the capitals differ, because upper or lower case makes no difference to an identifier. Temperatures is plural and describes the many REAL values stored, so the name matches the contents of the array. StudentNames says what the elements hold. A single letter like A tells the reader nothing about the data. Meaningful identifiers make the program easier to read, trace and fix. Short names such as A or X hide the purpose of the array. INPUT is a keyword, so it can never be used as an identifier. Scores is a valid and meaningful name.

Common mistakes: A is a meaningless name and it is not the same array as Scores. Use the descriptive identifier Scores: Scores[2] ← 82. The array is called Prices. Price is a different identifier, so it would refer to an array that does not exist. Use the same plural name: OUTPUT Prices[3].

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 449–458) 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.

Learning
Duo
Which array name is better for storing 30 students' names?
AStudentNames
Matches
DECLARE A : ARRAY[1:30] OF STRING
↓
The name A says nothing about the contents. It should be a meaningful name such as StudentNames.
Applying
Meanings
Term
meaningful identifier
Meaning
An array name that says what its elements hold, like StudentNames not A. It must never be a keyword such as INPUT or FOR, and upper or lower case makes no difference.
Practice
DECLARE StudentNames : ARRAY[1:30] OF STRING
Testing
Gaps
[1] ← "Ava"
Check Answer
Spots
1Scores[1] ← 75
2A[2] ← 82

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Red Panda' badge — Forest Explorer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which array name is better for storing 30 students' names?
A. A
B. StudentNames ✓
StudentNames says what the elements hold. A single letter like A tells the reader nothing about the data.
2. Which statement is correct?
A. An array identifier should describe what its elements hold ✓
B. An array identifier should be as short as possible
Meaningful identifiers make the program easier to read, trace and fix. Short names such as A or X hide the purpose of the array.
3. Which declaration uses a valid identifier for the array?
A. DECLARE Scores : ARRAY[1:10] OF INTEGER ✓
B. DECLARE INPUT : ARRAY[1:10] OF INTEGER
INPUT is a keyword, so it can never be used as an identifier. Scores is a valid and meaningful name.
4. In pseudocode, are StudentNames and studentnames the same identifier?
A. Yes, identifiers are case insensitive ✓
B. No, they are two different arrays
Pseudocode identifiers are case insensitive, so upper or lower case makes no difference. Use the same spelling each time to keep the code clear.
5. Which identifier must NOT be used for an array?
A. ForecastTemps
B. FOR ✓
FOR is a keyword used to start a loop. ForecastTemps is a different word that merely starts with the letters FOR, so it is allowed.

Match the Pairs

DECLARE StudentNames : ARRAY[1:30] OF STRING → A meaningful array identifier: the name tells you the elements are student names
DECLARE FOR : ARRAY[1:10] OF INTEGER → Not allowed: FOR is a keyword so it can never be used as an array identifier
Identifiers are case insensitive, so StudentNames and STUDENTNAMES refer to the same array → StudentNames[1] ← "Ava" OUTPUT STUDENTNAMES[1]
A plural name suits an array that holds many values of the same kind, such as several temperatures → DECLARE Temperatures : ARRAY[1:7] OF REAL
DECLARE A : ARRAY[1:30] OF STRING → The name A says nothing about the contents. It should be a meaningful name such as StudentNames.
DECLARE INPUT : ARRAY[1:5] OF INTEGER INPUT[1] ← 20 → INPUT is a keyword, so it cannot be an array identifier. Use a name such as Scores instead.

Key Term

meaningful identifier
An array name that says what its elements hold, like StudentNames not A. It must never be a keyword such as INPUT or FOR, and upper or lower case makes no difference.

Fill in the Blanks

1. DECLARE StudentNames : ARRAY[1:30] OF STRING StudentNames[1] ← "Ava"
Hint: Type the array identifier that was declared on the line above.
2. DECLARE Marks : ARRAY[1:5] OF INTEGER MARKS[2] ← 75
Hint: Identifiers are case insensitive. Type the declared array name written entirely in capital letters.
3. FOR Index ← 1 TO 3 INPUT TeamNames[Index] NEXT Index
Hint: Type the keyword that reads a value from the user. Keywords like this can never be used as array identifiers.
4. DECLARE StudentAges : ARRAY[1:30] OF INTEGER
Hint: Type the data type that matches what the meaningful array name says the elements hold.
5. DECLARE ExamMarks : ARRAY[1:20] OF INTEGER
Hint: Type the keyword that declares a list of elements. It is reserved, so it cannot be used as an identifier.

Spot the Error

Question 1
A Scores[1] ← 75
B A[2] ← 82
C OUTPUT Scores[2]
Line B — A is a meaningless name and it is not the same array as Scores. Use the descriptive identifier Scores: Scores[2] ← 82.
Question 2
A FOR Pos ← 1 TO 3
B INPUT Prices[Pos]
C NEXT Pos
D OUTPUT Price[3]
Line D — The array is called Prices. Price is a different identifier, so it would refer to an array that does not exist. Use the same plural name: OUTPUT Prices[3].
Question 3
A Colours[1] ← "red"
B OUTPUT[2] ← "blue"
C OUTPUT Colours[2]
Line B — OUTPUT is a keyword, so it can never be used as an identifier. The array name should be Colours: Colours[2] ← "blue".
Question 4
A FOR Day ← 1 TO 7
B INPUT Names[Day]
C NEXT Day
D OUTPUT Temperatures[1]
Line B — The array holds temperatures, so calling it Names is misleading and does not match the rest of the program. Use INPUT Temperatures[Day].
Question 5
A StudentNames[1] ← "Ava"
B StudentNames[2] ← "Ben"
C Student Names[3] ← "Cy"
Line C — An identifier cannot contain a space. Write the name as one word: StudentNames[3] ← "Cy".

Student with a class code? Join your class →