Writing a validated input algorithm in pseudocode
DECLARE the variable, OUTPUT a prompt, INPUT the value, OUTPUT an error message if it fails the check, and REPEAT ... UNTIL the value is acceptable.
Understanding Writing a validated input algorithm in pseudocode in IGCSE Computer Science Paper 2
What it does: DECLARE creates the variable with its data type before the INPUT command stores a value in it. Comparing with <> "" checks that something was typed, so the loop repeats until the field is not empty. UNTIL holds the condition for an ACCEPTABLE value. The loop stops when the value is valid. The wrong line describes invalid values. Keywords such as REPEAT and UNTIL are written in capital letters. The lines inside the loop are indented so the structure is clear.
Common mistakes: A DECLARE statement needs a colon between the identifier and the data type. It should be DECLARE Age : INTEGER. Cambridge pseudocode keywords must be written in capital letters. The loop must start with REPEAT, not Repeat.
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 60–70) and word search (Modules 47–70).
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
validation loopFill in the Blanks
Spot the Error
Student with a class code? Join your class →