Declaring a constant with CONSTANT
Declares a named value that is set once. No DECLARE line or data type is needed: the type comes from the literal, so 6.50 makes it REAL. The value cannot change later.
Understanding Declaring a constant with CONSTANT in IGCSE Computer Science Paper 2
What it does: This line follows the pattern CONSTANT <identifier> ← <value>, with the literal 100 as the value. There is only one line and no type is written. The literal 0.20 has a decimal point, so VATRate is a REAL. CONSTANT HourlyRate ← 6.50 is the complete declaration. No DECLARE line is needed. Cambridge pseudocode uses the ← operator to give a constant its value, not the = sign. A constant keeps the same value for the whole program. If a value needs to change, use a variable.
Common mistakes: A CONSTANT line has no data type. The type comes from the literal, so 6.50 makes it REAL. It should be CONSTANT Rate ← 6.50. A string literal must be in double quotes. Without them, N/A is not a valid value. It should be CONSTANT DefaultText ← "N/A".
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
CONSTANT HourlyRate ← 6.50Fill in the Blanks
Spot the Error
Student with a class code? Join your class →