Assigning the result of an expression
The expression on the right is worked out first, then its result is stored in the variable on the left, replacing any old value that variable held.
Understanding Assigning the result of an expression in IGCSE Computer Science Paper 2
What it does: The right-hand side can be just another variable. Its current value is copied into BackupScore, and Score keeps its value. Length * Width is worked out first, then the result is stored in Area on the left of the arrow. The old value 4 is used on the right to work out 4 + 1 = 5. Then 5 replaces the old value in Counter.
Common mistakes: The variable being assigned to must be on the left of the arrow and the value on the right. It should be Rate ← 12.5. The expression must use the variable Counter, whose old value is read and then replaced. Count was never declared or given a value. It should be Counter ← Counter + 1.
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 317–326) and word search (Modules 317–336).
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
TotalToPay ← NumberOfHours * HourlyRateFill in the Blanks
Spot the Error
Student with a class code? Join your class →