Writing an algorithm in pseudocode from a problem
To write an algorithm from a problem, DECLARE variables first, then INPUT, process with IF, CASE or a loop, then OUTPUT. Check each part against the problem and use the exam format.
Understanding Writing an algorithm in pseudocode from a problem in IGCSE Computer Science Paper 2
What it does: CASE OF is chosen when one variable is compared against several set values, as in a menu. A known number of repeats, such as 5 scores, means a count-controlled FOR loop is the correct structure. Declare your variables first. Then write INPUT, the process and OUTPUT in that order. There are two outcomes from one test, so use selection with IF. A FOR loop is for repeating a fixed number of times. Exam pseudocode has keywords in upper case and the type after a colon, for example DECLARE Age : INTEGER. INPUT is a keyword followed by the variable name that will store the value.
Common mistakes: A DECLARE statement needs a colon between the identifier and the data type. It should be DECLARE Num2 : INTEGER. The problem says a mark of 50 or more passes, but > leaves out a mark of exactly 50. The condition should be Mark >= 50.
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 254–264) and word search (Modules 254–274).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
DECLARE, INPUT, process, OUTPUTFill in the Blanks
Spot the Error
Student with a class code? Join your class →