← IGCSE Computer Science Paper 2

Pseudocode, flowcharts and program code

Cambridge's fixed format for planning an algorithm before it is written as program code. Paper 2 answers must use it, except the 15-mark question, which allows Python, VB or Java.

Understanding Pseudocode, flowcharts and program code in IGCSE Computer Science Paper 2

What it does: IF and THEN are keywords in upper case, as the fixed pseudocode format requires. The diamond with two exits is the flowchart version of IF ... ELSE ... ENDIF, so both plan the same algorithm. Paper 2 solutions must be written in pseudocode, using the ← assignment arrow and the Cambridge keywords. Python is only allowed in the 15-mark scenario question. Algorithms must be exact. A wrong symbol or a missing keyword can make the steps wrong, and it can lose marks in the exam. Planning comes first. You work out the steps in pseudocode or a flowchart, and then you write the program code.

Common mistakes: Cambridge pseudocode assigns a value with the arrow ←, not =. The line should be Total ← 0. Pseudocode keywords must be written in upper case. The line should start with IF, not if.

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 136–145) and word search (Modules 123–145).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which is true about pseudocode?
It is a real programming language that a computer can run directlyIt is a planning format for an algorithm, not tied to one programming language
Matches
if mark >= 50 then output "Pass" endif
↓
The keywords are in lower case, but Cambridge pseudocode needs IF, THEN, OUTPUT and ENDIF in upper case. Precision matters.
Applying
Meanings
Term
pseudocode
Meaning
Cambridge's fixed format for planning an algorithm before it is written as program code. Paper 2 answers must use it, except the 15-mark question, which allows Python, VB or Java.
Practice
// Plan the algorithm in pseudocode
Testing
Gaps
Total 0
Check Answer
Spots
1DECLARE Total : INTEGER
2Total = 0

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

The 'Owl' badge — Wise Coder, 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 true about pseudocode?
A. It is a planning format for an algorithm, not tied to one programming language ✓
B. It is a real programming language that a computer can run directly
Pseudocode is used to plan an algorithm. It follows Cambridge's fixed format but a computer cannot run it. Program code is the real language version.
2. A Paper 2 question says 'Write an algorithm in pseudocode'. Which answer is correct?
A. Use the Cambridge pseudocode format, e.g. total ← total + 1 ✓
B. Use Python, e.g. total = total + 1
Paper 2 solutions must be written in pseudocode, using the ← assignment arrow and the Cambridge keywords. Python is only allowed in the 15-mark scenario question.
3. Which Paper 2 question allows you to answer in Python, Visual Basic or Java?
A. Any question that asks for an algorithm
B. The 15-mark scenario question ✓
Only the 15-mark scenario question lets you choose a program language. Every other algorithm answer must use pseudocode.
4. Which of these is a valid choice of language for the 15-mark scenario question?
A. Java ✓
B. C++
Cambridge allows Python, Visual Basic or Java for the 15-mark question. Other languages are not on the list.
5. Which line is written in Cambridge pseudocode?
A. for count in range(1, 11):
B. FOR Count ← 1 TO 10 ✓
FOR ... TO with an upper case keyword and the ← arrow is pseudocode. The range() loop is Python program code.

Match the Pairs

total ← total + mark → Pseudocode: the Cambridge assignment arrow stores a new value in the variable
total = total + mark → Program code (such as Python): the equals sign is used for assignment
Pseudocode keywords must be written in upper case in the Cambridge format → IF mark >= 50 THEN
A flowchart shows a decision as a diamond with Yes and No branches, matching an IF in pseudocode → IF mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF
if mark >= 50 then output "Pass" endif → The keywords are in lower case, but Cambridge pseudocode needs IF, THEN, OUTPUT and ENDIF in upper case. Precision matters.
print("Pass") in a Paper 2 pseudocode answer → Python's print() is program code. Paper 2 answers must use pseudocode such as OUTPUT, except the 15-mark question, which allows Python, VB or Java.

Key Term

pseudocode
Cambridge's fixed format for planning an algorithm before it is written as program code. Paper 2 answers must use it, except the 15-mark question, which allows Python, VB or Java.

Fill in the Blanks

1. Total ← 0
Hint: Type the pseudocode assignment symbol (typed as an arrow made from two keys).
2. OUTPUT Total
Hint: Type the upper case pseudocode keyword that displays a value.
3. print(Total)
Hint: Type the Python function that shows a value on screen.
4. IF Score ≥ 50 THEN OUTPUT "Pass" ENDIF
Hint: Type the pseudocode keyword that closes a selection statement.
5. if Score >= 50: print("Pass")
Hint: Type the punctuation mark that ends an if line in Python.

Spot the Error

Question 1
A DECLARE Total : INTEGER
B Total = 0
C INPUT Score
D Total ← Total + Score
E OUTPUT Total
Line B — Cambridge pseudocode assigns a value with the arrow ←, not =. The line should be Total ← 0.
Question 2
A INPUT Age
B if Age >= 16 THEN
C OUTPUT "Allowed"
D ENDIF
Line B — Pseudocode keywords must be written in upper case. The line should start with IF, not if.
Question 3
A total = 0
B for n in range(5):
C total ← total + n
D print(total)
Line C — This is Python, which is allowed in the 15-mark question. Python uses = for assignment. The arrow ← belongs only in pseudocode. It should be total = total + n.
Question 4
A # Add two numbers
B INPUT A
C INPUT B
D OUTPUT A + B
Line A — A comment in Cambridge pseudocode starts with //. The # symbol is Python comment style. It should be // Add two numbers.
Question 5
A Total ← 0
B FOR Count ← 1 TO 5
C Total ← Total + Count
D ENDFOR
E OUTPUT Total
Line D — A pseudocode FOR loop is closed with NEXT followed by the loop variable, not ENDFOR. The line should be NEXT Count.

Student with a class code? Join your class →