Cambridge Pseudocode Standards & Identifier Tables

In Cambridge International examinations, algorithms written in pseudocode must adhere strictly to the standardized conventions defined in the syllabus. This ensures unambiguous readability and consistency across all computing tasks.


1. Golden Rules of Cambridge Pseudocode

1. Keywords in UPPERCASE

All language reserved words and control structures must be capitalized:

  • Declarations: DECLARE, CONSTANT
  • Input / Output: INPUT, OUTPUT
  • Selection: IF, THEN, ELSE, ENDIF, CASE, OF, OTHERWISE, ENDCASE
  • Iteration: FOR, TO, STEP, NEXT, WHILE, DO, ENDWHILE, REPEAT, UNTIL
  • Subroutines: PROCEDURE, ENDPROCEDURE, FUNCTION, RETURNS, ENDFUNCTION, CALL
  • Boolean Literals: TRUE, FALSE

2. Assignment Arrow (<-)

In Cambridge pseudocode, the assignment operator is the arrow <-:

Counter <- Counter + 1
TaxRate <- 0.175
IsValid <- TRUE

Exam Warning: Using = for assignment (e.g., Counter = Counter + 1) is an error. The = sign is reserved exclusively as a relational operator for comparing equality.

3. Meaningful Identifiers

Variable, constant, and subroutine names must be self-documenting:

  • Good: TotalPrice, StudentName, Index, IsRegistered
  • Often unclear without context: x, temp1, a, foo

2. Standard Cambridge Data Types

Data Type

Description

Exam Literal Examples

INTEGER

Whole numbers (positive, negative, or zero) without fractional parts.

42, -7, 0

REAL

Floating-point numbers with fractional / decimal components.

3.14159, -0.5, 12.0

CHAR

Exactly one alphanumeric character, symbol, or punctuation mark.

'A', '9', '#'

STRING

An ordered sequence of zero or more characters enclosed in double quotes.

"IGCSE Computer Science", ""

BOOLEAN

Logical truth values taking only one of two states.

TRUE, FALSE


3. The Identifier Table

An identifier table is a useful design aid for recording names, types and purposes:

Identifier

Data Type

Purpose / Description

CandidateID

STRING

Unique alphanumeric candidate registration code (e.g. "C1042")

RawMarks

INTEGER

Total raw marks achieved on examination (0 to 100)

Percentage

REAL

Calculated percentage score rounded to one decimal place

IsPassed

BOOLEAN

Flags whether candidate met the minimum passing threshold (>= 50%)

Grade

CHAR

Letter grade awarded ('A', 'B', 'C', 'D', 'E', 'U')

Written practice and self-review

A student wrote the following Cambridge pseudocode declarations:

DECLARE 1stScore : INT
DECLARE Total Score : REAL

Identify the three syntax errors in these declarations according to Cambridge pseudocode standards and explain how each should be corrected.

Write an explanation before checking the theory. Check that each claim answers the question, uses the correct concept and explains why it applies. Discuss uncertain points with a teacher. The structured exercise below checks specific facts; it does not automatically mark this explanation.

Maintainability practice

Use meaningful identifiers, suitable comments, procedures/functions for coherent tasks and named constants for fixed values. In a ticket program, replace x with TicketTotal and a repeated price literal with a named constant; indent the body of each selection and loop. Explain why a comment such as “ignore the terminating -1” is more helpful than repeating “add one” beside Count <- Count + 1. Short conventional loop names can still be clear in context.

AI Socratic Tutor

All-Access
Sign in or create an account. AI Tutor is an All-Access benefit.
Sign Up

Need guidance? Ask a question or use the hint below.

AI Socratic Tutor is an All-Access Benefit

Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.

You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.

Exam-Style Check: Cambridge Assignment & Keyword Rules

• Multiple Choice
+25 XP
Question

Which statement correctly assigns the integer value 25 to the variable StudentAge according to Cambridge pseudocode standards?

All-Access Required

Interactive exercises for Module 2 and beyond require an active plan.