← IGCSE Computer Science Paper 2

CONSTANT

Names a value set once with a literal. It never changes, needs no DECLARE, and can be updated in one place.

Understanding CONSTANT in IGCSE Computer Science Paper 2

What it does: The value 20 is a literal, so this is a correct constant. Constants are not set from calculations or user input. The CONSTANT line both names the identifier and sets its value, so no separate DECLARE statement is needed. A constant can only be set using a literal such as 100. It cannot be set using a variable or a calculation. A constant is set once and never changes. A variable is the kind of identifier that can change. If the rate changes, you edit one CONSTANT line instead of finding every 6.50 in the program. Pseudocode uses ← to assign a value. A single = is used for comparison, not assignment.

Common mistakes: A constant is given its value with the assignment arrow ←, not =. The line should be CONSTANT HourlyRate ← 6.50. A constant does not need DECLARE. The CONSTANT statement creates it and gives it its value, so the line should be CONSTANT VatRate ← 0.2.

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 146–155) and word search (Modules 146–165).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which line correctly creates a constant in IGCSE pseudocode?
CONSTANT HourlyRate ← 6.50DECLARE HourlyRate : CONSTANT
Matches
DECLARE HourlyRate : REAL CONSTANT HourlyRate ← 6.50
↓
A constant does not need a DECLARE line. DECLARE is for variables, so the first line should be removed.
Applying
Meanings
Term
CONSTANT HourlyRate ← 6.50
Meaning
Names a value set once with a literal. It never changes, needs no DECLARE, and can be updated in one place.
Practice
CONSTANT HourlyRate ← 6.50
Testing
Gaps
HourlyRate ← 6.50
Check Answer
Spots
1DECLARE Hours : INTEGER
2CONSTANT HourlyRate = 6.50

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

The 'Clownfish' badge — Reef Rookie, 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 line correctly creates a constant in IGCSE pseudocode?
A. DECLARE HourlyRate : CONSTANT
B. CONSTANT HourlyRate ← 6.50 ✓
A constant is written as CONSTANT <identifier> ← <value>. The value is given with a literal.
2. True or false: a constant needs a DECLARE statement before it is used.
A. True
B. False ✓
A CONSTANT line sets the name and value in one step, so no DECLARE is needed.
3. Which is a valid value to give a constant?
A. CONSTANT MaxScore ← 100 ✓
B. CONSTANT MaxScore ← Total * 2
A constant can only be set using a literal such as 100. It cannot be set using a variable or a calculation.
4. What happens to the value of HourlyRate while the program runs?
A. It stays at 6.50 and never changes ✓
B. It changes each time the loop repeats
A constant is set once and never changes. A variable is the kind of identifier that can change.
5. Which is the main advantage of using CONSTANT HourlyRate ← 6.50 instead of typing 6.50 in many places?
A. You only update the value in one place ✓
B. The program runs much faster
If the rate changes, you edit one CONSTANT line instead of finding every 6.50 in the program.

Match the Pairs

CONSTANT HourlyRate ← 6.50 → Creates a constant called HourlyRate that is set once to 6.50 and never changes while the program runs
CONSTANT MaxScore ← 100 → Sets MaxScore to the literal 100 with no DECLARE needed, so changing the 100 here updates it everywhere
A constant is given its value using only a literal, not a calculation or an INPUT → CONSTANT VatRate ← 20
A constant needs no DECLARE, so it is created in a single line that gives it its name and value → CONSTANT PassMark ← 50
DECLARE HourlyRate : REAL CONSTANT HourlyRate ← 6.50 → A constant does not need a DECLARE line. DECLARE is for variables, so the first line should be removed.
CONSTANT HourlyRate ← Hours * 6.50 → The value of a constant must be a literal such as 6.50, not an expression that uses a variable like Hours.

Key Term

CONSTANT HourlyRate ← 6.50
Names a value set once with a literal. It never changes, needs no DECLARE, and can be updated in one place.

Fill in the Blanks

1. CONSTANT HourlyRate ← 6.50
Hint: Type the keyword that names a value which never changes.
2. CONSTANT HourlyRate ← 6.50
Hint: Type the symbol that gives the constant its value.
3. CONSTANT HourlyRate ← 6.50 Pay ← Hours * HourlyRate
Hint: Type the constant's name so the pay uses the fixed rate.
4. CONSTANT MaxMarks ← 100 Percent ← Mark / MaxMarks * 100
Hint: Type the name of the constant that holds the top mark.
5. CONSTANT HourlyRate ← 6.50 Hours ← 4 Pay ← Hours * HourlyRate
Hint: Type the variable that holds the hours worked.

Spot the Error

Question 1
A DECLARE Hours : INTEGER
B CONSTANT HourlyRate = 6.50
C INPUT Hours
D OUTPUT Hours * HourlyRate
Line B — A constant is given its value with the assignment arrow ←, not =. The line should be CONSTANT HourlyRate ← 6.50.
Question 2
A DECLARE CONSTANT VatRate ← 0.2
B DECLARE Price : REAL
C INPUT Price
D OUTPUT Price * VatRate
Line A — A constant does not need DECLARE. The CONSTANT statement creates it and gives it its value, so the line should be CONSTANT VatRate ← 0.2.
Question 3
A CONSTANT MaxScore ← 100
B DECLARE Score : INTEGER
C MaxScore ← 85
D OUTPUT Score / MaxScore
Line C — A constant is set once and never changes, so it cannot be assigned a new value. The line should change the variable: Score ← 85.
Question 4
A CONSTANT Pi ← 3.14
B DECLARE Radius : REAL
C INPUT Radius
D Pi ← Pi * Radius ^ 2
Line D — This line tries to change the constant Pi, which must never change. It should use Pi in an expression, for example OUTPUT Pi * Radius ^ 2.
Question 5
A CONSTANT DayRate ← 6.50 * 8
B DECLARE Days : INTEGER
C INPUT Days
D OUTPUT Days * DayRate
Line A — A constant must be set using only a literal, not a calculation. It should be CONSTANT DayRate ← 52.

Student with a class code? Join your class →