Combining validation checks
Joins several validation checks into one condition, so the input must pass every check. Examples: presence and length together, or range and type together.
Understanding Combining validation checks in IGCSE Computer Science Paper 2
What it does: Each check has its own IF with its own message, so the user is told exactly which check failed. Joining a range check and a whole-number check with AND means the mark is only valid if every check passes. Separate messages help the user fix the exact problem. Every check still has to be run. AND joins the two conditions, so the code is only accepted if it is not empty and has exactly 6 characters. AND means both conditions must be true, so a value outside either limit is rejected. The condition with AND must be followed by THEN before the statements that run when the checks pass.
Common mistakes: The presence and length checks must both pass, so they are joined with AND. With OR, a name that is too long would still be accepted as long as it is not empty. It should be IF Name <> "" AND Len <= 10 THEN. The upper limit of the range check uses the wrong operator. Age >= 9 only accepts 9 or more, so the range 5 to 9 is not checked. It should be Age <= 9.
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
ANDFill in the Blanks
Spot the Error
Student with a class code? Join your class →