← IGCSE Computer Science Paper 2

Pascal case names for subroutines

A Pascal case subroutine name: it starts with a capital letter, each word is capitalised, and it uses only letters and digits, with no spaces, no underscores and no starting digit.

Understanding Pascal case names for subroutines in IGCSE Computer Science Paper 2

What it does: CalculateTotal describes the job of the function (working out a total) and follows Pascal case, so the name explains the purpose. ShowScore2 uses a digit at the end, which is allowed. The name still starts with a capital letter, so it is valid. A subroutine name cannot contain spaces. Join the words together and capitalise each one: DefaultLine. Pascal case names use only letters and digits. Underscores and spaces are not used. A descriptive name such as CalculateTotal tells the reader what the subroutine does. A short name like Ct does not.

Common mistakes: The call uses an underscore, but Pascal case names contain only letters and digits. The name should be written as DefaultLine, so the call is CALL DefaultLine(). A Pascal case name must start with a capital letter. calculateTotal starts with a lowercase c. It should be CalculateTotal.

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 399–408) and word search (Modules 399–418).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which is a correct Cambridge pseudocode name for a subroutine?
SumSquaresum_square
Matches
PROCEDURE default_line()
↓
The name uses an underscore and starts with a lowercase letter. Pascal case needs DefaultLine with no underscore.
Applying
Meanings
Term
CalculateTotal
Meaning
A Pascal case subroutine name: it starts with a capital letter, each word is capitalised, and it uses only letters and digits, with no spaces, no underscores and no starting digit.
Practice
PROCEDURE CalculateTotal(Price : REAL)
Testing
Gaps
PROCEDURE ()
Check Answer
Spots
3ENDPROCEDURE
4CALL Default_Line()

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

The 'Red Panda' badge — Forest Explorer, 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 is a correct Cambridge pseudocode name for a subroutine?
A. sum_square
B. SumSquare ✓
SumSquare is in Pascal case: each word starts with a capital letter and there are no underscores or spaces.
2. Which procedure name follows the Pascal case rule?
A. DefaultLine ✓
B. Default Line
A subroutine name cannot contain spaces. Join the words together and capitalise each one: DefaultLine.
3. Which function name is written correctly?
A. CalculateTotal ✓
B. calculatetotal
Each word in a Pascal case name starts with a capital letter, so CalculateTotal is correct. All lower case does not follow the convention.
4. Which name is NOT allowed because of how it starts?
A. DoubleIt2 is not allowed
B. 2DoubleIt is not allowed ✓
A name must not start with a digit. DoubleIt2 is fine because the digit comes at the end.
5. Which character is allowed in a Pascal case subroutine name?
A. A digit such as 2 (after the first letter) ✓
B. An underscore _
Pascal case names use only letters and digits. Underscores and spaces are not used.

Match the Pairs

PROCEDURE DefaultLine() → A valid Pascal case procedure name: capital letter at the start of each word, with letters only
FUNCTION SumSquare(Num : INTEGER) RETURNS INTEGER → A valid Pascal case function name made of two capitalised words joined together
A descriptive Pascal case name tells the reader what the subroutine does → FUNCTION CalculateTotal(Price : REAL) RETURNS REAL
A name may contain digits, but it must start with a capital letter and not a digit → PROCEDURE ShowScore2()
PROCEDURE default_line() → The name uses an underscore and starts with a lowercase letter. Pascal case needs DefaultLine with no underscore.
FUNCTION 2DSum(A : INTEGER) RETURNS INTEGER → The name starts with a digit. A subroutine name must start with a capital letter, for example SumSquare.

Key Term

CalculateTotal
A Pascal case subroutine name: it starts with a capital letter, each word is capitalised, and it uses only letters and digits, with no spaces, no underscores and no starting digit.

Fill in the Blanks

1. PROCEDURE DefaultLine() OUTPUT "----------" ENDPROCEDURE
Hint: Type the Pascal case procedure name: two capitalised words joined with no space or underscore, describing a standard line that gets printed.
2. FUNCTION SumSquare() RETURNS INTEGER RETURN 3 * 3 + 4 * 4 ENDFUNCTION
Hint: Type the Pascal case function name: two capitalised words joined together that describe adding squares.
3. FUNCTION CalculateTotal() RETURNS INTEGER RETURN 10 + 20 ENDFUNCTION
Hint: Type a descriptive Pascal case function name: a verb followed by a noun, both capitalised, with no space.
4. PROCEDURE CalculateTotal() OUTPUT 10 + 20 ENDPROCEDURE
Hint: Type the first letter of this procedure name. Pascal case starts with a capital letter.
5. FUNCTION SumSquare() RETURNS INTEGER RETURN 3 * 3 + 4 * 4 ENDFUNCTION
Hint: Type the letter that starts the second word of the name. In Pascal case each new word begins with a capital.

Spot the Error

Question 1
A PROCEDURE DefaultLine()
B OUTPUT "----------"
C ENDPROCEDURE
D CALL Default_Line()
Line D — The call uses an underscore, but Pascal case names contain only letters and digits. The name should be written as DefaultLine, so the call is CALL DefaultLine().
Question 2
A Price ← 10
B PROCEDURE calculateTotal()
C OUTPUT Price * 3
D ENDPROCEDURE
Line B — A Pascal case name must start with a capital letter. calculateTotal starts with a lowercase c. It should be CalculateTotal.
Question 3
A // Show the score
B PROCEDURE Show Score(S : REAL)
C OUTPUT S
D ENDPROCEDURE
Line B — A subroutine name cannot contain spaces. The words must be joined, with each word starting with a capital letter: ShowScore.
Question 4
A FUNCTION GetTax() RETURNS REAL
B RETURN 0.2
C ENDFUNCTION
D OUTPUT getTax()
Line D — The call starts with a lowercase g, which is camelCase and not Pascal case. The function is named GetTax, so it must be called as GetTax().
Question 5
A PROCEDURE 2PrintLine()
B OUTPUT "=========="
C ENDPROCEDURE
D CALL PrintLine2()
Line A — A subroutine name cannot start with a digit. Digits are allowed inside the name, but the first character must be a capital letter, as in PrintLine2.

Student with a class code? Join your class →