Type check
A validation check that tests an input is the expected data type, such as a whole number (INTEGER) for an age, and rejects letters or other wrong types.
Understanding Type check in IGCSE Computer Science Paper 2
What it does: The check tests the data type of Age and gives an error message if it is not an INTEGER, so letters are rejected. Being non-empty is a presence check. The type check rejects 'Ten' because it is a STRING. '4two' mixes digits and letters, so it is not an INTEGER. 42 is a whole number and passes.
Common mistakes: The program must read the age with INPUT Age so the value can be checked as an INTEGER. OUTPUT only displays a value and does not read one. An age is a whole number, so the type check expects INTEGER. Declaring Age as STRING would accept letters and break the arithmetic. It should be DECLARE Age : INTEGER.
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 47–57) 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
type checkFill in the Blanks
Spot the Error
Student with a class code? Join your class →