Writing a value into an array element
Stores a value in one array element using the assignment operator ←. The value must match the array's data type, and it replaces any old value already in that element.
Understanding Writing a value into an array element in IGCSE Computer Science Paper 2
What it does: Strings are written in double quotes in IGCSE pseudocode, so the value "Blue" is stored in element 2 of a STRING array. In IGCSE pseudocode, the index goes in square brackets and the assignment operator is ←. Round brackets and = are not used for assignment. The value must match the array's data type. An INTEGER array can only store whole numbers, not text. Assigning replaces the old value. An element holds only one value at a time, so "Ali" is overwritten. Name[index] ← value changes just one element. The other elements keep their values.
Common mistakes: Assigning a value to an array element uses the assignment operator ←, not =. It should be StudentNames[3] ← "Cy". A string value must be written in double quotes. Without them, Plum looks like a variable name. It should be Fruit[3] ← "Plum".
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.
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
StudentNames[1] ← "Ali"Fill in the Blanks
Spot the Error
Student with a class code? Join your class →