← IGCSE Computer Science Paper 2

Identifier rules in Cambridge pseudocode

The name of a variable, constant, procedure or function. Use PascalCase: letters and digits only, no spaces or underscores, start with a capital letter, e.g. FirstName.

Understanding Identifier rules in Cambridge pseudocode in IGCSE Computer Science Paper 2

What it does: TotalScore joins two words with no space or underscore, and each word starts with a capital letter, which is the PascalCase style. FirstName uses PascalCase with letters only. Underscores are not allowed in identifiers. Keywords such as OUTPUT, IF and INPUT are reserved for the language, so they cannot be used as identifiers. An identifier is the name given to a variable, constant, procedure or function.

Common mistakes: An identifier cannot contain spaces, so 'First Name' is read as two separate words. It should be INPUT FirstName. Identifiers may only use letters and digits, so underscores are not allowed. Use PascalCase: DECLARE TotalScore : INTEGER.

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 307–316) and word search (Modules 296–316).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which identifier follows the Cambridge pseudocode rules?
FirstNamefirst_name
Matches
DECLARE first_name : STRING
↓
The identifier contains an underscore. Only letters and digits are allowed, so it should be FirstName.
Applying
Meanings
Term
identifier
Meaning
The name of a variable, constant, procedure or function. Use PascalCase: letters and digits only, no spaces or underscores, start with a capital letter, e.g. FirstName.
Practice
DECLARE FirstName : STRING
Testing
Gaps
OUTPUT
Check Answer
Spots
2DECLARE Age : INTEGER
3INPUT First Name

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

The 'Constellation Wolf' badge — Space Legend, 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 identifier follows the Cambridge pseudocode rules?
A. first_name
B. FirstName ✓
FirstName uses PascalCase with letters only. Underscores are not allowed in identifiers.
2. Which identifier is valid?
A. TotalScore ✓
B. Total Score
Identifiers cannot contain spaces. Join the words together in PascalCase: TotalScore.
3. Which identifier is valid?
A. 1Player
B. Player1 ✓
An identifier cannot start with a digit. Digits are allowed, but only after the first letter, as in Player1.
4. Which identifier is valid?
A. Price ✓
B. Price$
Identifiers can only contain letters and digits. Symbols such as $ are not allowed.
5. Which identifier is valid?
A. Cafe ✓
B. Café
Accented letters like é are not allowed. Use only the plain letters A-Z and a-z.

Match the Pairs

FirstName → A valid identifier: PascalCase, letters only, starts with a capital letter
Score2 → A valid identifier that uses a digit after the first character
An identifier must not contain spaces or underscores, so join the words together in PascalCase → DECLARE TotalScore : INTEGER
An identifier can be the name of a constant as well as a variable, and it still follows the PascalCase rules → CONSTANT PassMark ← 50
DECLARE first_name : STRING → The identifier contains an underscore. Only letters and digits are allowed, so it should be FirstName.
DECLARE 2ndScore : INTEGER → The identifier starts with a digit. An identifier must start with a capital letter, so it should be SecondScore.

Key Term

identifier
The name of a variable, constant, procedure or function. Use PascalCase: letters and digits only, no spaces or underscores, start with a capital letter, e.g. FirstName.

Fill in the Blanks

1. DECLARE FirstName : STRING FirstName ← "Ava" OUTPUT FirstName
Hint: Type the PascalCase identifier of the variable declared on the first line.
2. DECLARE TotalScore : INTEGER TotalScore ← 0 OUTPUT TotalScore
Hint: Type the keyword that creates a variable. A keyword like this is reserved, so it can't be used as an identifier.
3. DECLARE Score2 : INTEGER Score2 ← 10 OUTPUT Score2
Hint: Type the identifier from the first line. It has a digit after the letters, which is allowed.
4. CONSTANT MaxScore ← 100 OUTPUT "Top mark:" OUTPUT MaxScore
Hint: Type the identifier of the constant. Each new word in it starts with a capital letter, with no spaces or underscores.
5. DECLARE TotalCost : REAL TotalCost ← 9.5 OUTPUT TotalCost
Hint: Type the reserved keyword that displays a value. Keywords like this can't be used as identifiers.

Spot the Error

Question 1
A DECLARE FirstName : STRING
B DECLARE Age : INTEGER
C INPUT First Name
D OUTPUT FirstName
Line C — An identifier cannot contain spaces, so 'First Name' is read as two separate words. It should be INPUT FirstName.
Question 2
A DECLARE Score : INTEGER
B DECLARE Total_Score : INTEGER
C TotalScore ← Score * 2
Line B — Identifiers may only use letters and digits, so underscores are not allowed. Use PascalCase: DECLARE TotalScore : INTEGER.
Question 3
A DECLARE 1stPlayer : STRING
B INPUT FirstPlayer
C OUTPUT FirstPlayer
Line A — An identifier cannot start with a digit. It must start with a letter, so the line should be DECLARE FirstPlayer : STRING.
Question 4
A DECLARE Price : REAL
B DECLARE Quantity : INTEGER
C INPUT Quantity
D Price ← Quantité * 2.5
Line D — Identifiers cannot contain accented letters such as é. Only the plain letters A-Z and digits are allowed, so it should be Quantity.
Question 5
A CONSTANT MaxMark ← 100
B DECLARE Mark : INTEGER
C INPUT Mark$
D OUTPUT Mark, MaxMark
Line C — Symbols such as $ cannot be used in identifiers. Only letters and digits are allowed, so it should be INPUT Mark.

Student with a class code? Join your class →