← IGCSE Computer Science Paper 2

Choosing validation or verification

Validation checks data is acceptable, like an age range check. Verification checks it was typed correctly, like double entry. A scenario may need one or both.

Understanding Choosing validation or verification in IGCSE Computer Science Paper 2

What it does: The range check validates the age. Adding double entry as well would also verify it, so both together give better protection. Comparing the two entries is verification. The 'because' links the check to the reason it is needed. Validation = is the data acceptable? Verification = was the data entered correctly? Double entry only checks that the two entries match. It cannot prove the data is the true value. A range check is a validation check because it tests whether the data is reasonable or allowed. A value can pass validation and still be wrong, which is why a scenario may need both validation and verification.

Common mistakes: Double entry is verification. The program must warn the user when the two entries do NOT match, so the condition should be Pass1 <> Pass2. A range check rejects ages outside the range. No number is both below 0 and above 120, so AND never catches anything. It should be OR.

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 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.

Learning
Duo
A website asks for an age. The age must be between 11 and 18. Which is needed?
Verification (double entry), because it tests the age is acceptableValidation (a range check), because it tests the age is acceptable
Matches
Use a range check to verify a new password was typed correctly.
↓
A range check is validation, not verification. A new password should use double entry to verify it was typed correctly.
Applying
Meanings
Term
validation vs verification
Meaning
Validation checks data is acceptable, like an age range check. Verification checks it was typed correctly, like double entry. A scenario may need one or both.
Practice
// Age: range check (validation)
Testing
Gaps
IF Age >= 0 Age <= 120 THEN
Check Answer
Spots
2INPUT Pass2
3IF Pass1 = Pass2 THEN

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

The 'Oryx' badge — Desert Navigator, 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. A website asks for an age. The age must be between 11 and 18. Which is needed?
A. Validation (a range check), because it tests the age is acceptable ✓
B. Verification (double entry), because it tests the age is acceptable
A range check is validation. It tests whether data is acceptable. Double entry is verification, which only checks the data was typed the same twice.
2. A student sets a new password. The system asks them to type it twice. Which is this?
A. Validation, because it checks the password is a sensible value
B. Verification, because it checks the password was entered correctly ✓
Double entry is verification. The two entries are compared to check for typing mistakes.
3. Which statement is true?
A. Validation checks data is acceptable. Verification checks data was typed correctly. ✓
B. Validation checks data was typed correctly. Verification checks data is acceptable.
Validation = is the data acceptable? Verification = was the data entered correctly?
4. A user types 150 in an age field. The range check is 11 to 18. What happens?
A. Validation rejects it because 150 is outside the allowed range ✓
B. Verification rejects it because 150 does not match the second entry
The range check is validation, and 150 is outside 11 to 18. No second entry is involved.
5. A user types 15 twice by mistake when they are 14. Will double entry find the error?
A. Yes, because double entry proves the data is true
B. No, because both entries match even though the age is wrong ✓
Double entry only checks that the two entries match. It cannot prove the data is the true value.

Match the Pairs

Age field: range check (0 to 120) → Validation: it tests that the age entered is acceptable, but it cannot tell if the age is the right one.
New password: enter it twice and compare → Verification: double entry checks that the password was typed correctly, because both entries must match.
Using both gives better protection: validation stops impossible values and verification catches typing slips. → IF Age >= 0 AND Age <= 120 THEN OUTPUT "Age accepted" ENDIF
A justification uses 'because': double entry is needed for a new password because a typing slip could lock the user out. → IF Password1 = Password2 THEN OUTPUT "Passwords match" ENDIF
Use a range check to verify a new password was typed correctly. → A range check is validation, not verification. A new password should use double entry to verify it was typed correctly.
Age 25 passes the range check, so the age must be correct. → Validation only shows the age is acceptable, not correct. Someone could still mistype 25 instead of 52, so verification may be needed too.

Key Term

validation vs verification
Validation checks data is acceptable, like an age range check. Verification checks it was typed correctly, like double entry. A scenario may need one or both.

Fill in the Blanks

1. INPUT Age IF Age >= 0 AND Age <= 120 THEN
Hint: Type the logical operator that makes both parts of this age range check true
2. INPUT Password INPUT Confirm IF Password = Confirm THEN
Hint: Type the relational operator that compares the two entries of the new password
3. // An age range check is validation
Hint: Type the word for checking that data is acceptable and sensible
4. REPEAT INPUT Confirm UNTIL Password = Confirm
Hint: Type the keyword that ends a REPEAT loop and holds its condition
5. // Both checks are used because // range finds bad data, double entry typos
Hint: Type the linking word used to justify why a scenario needs both checks

Spot the Error

Question 1
A INPUT Pass1
B INPUT Pass2
C IF Pass1 = Pass2 THEN
D OUTPUT "Passwords differ"
E ENDIF
Line C — Double entry is verification. The program must warn the user when the two entries do NOT match, so the condition should be Pass1 <> Pass2.
Question 2
A INPUT Age
B IF Age < 0 AND Age > 120 THEN
C OUTPUT "Age not valid"
D ENDIF
Line B — A range check rejects ages outside the range. No number is both below 0 and above 120, so AND never catches anything. It should be OR.
Question 3
A INPUT Age
B WHILE Age > 11 OR Age < 18 DO
C OUTPUT "Enter 11 to 18"
D INPUT Age
E ENDWHILE
Line B — The loop should repeat while the age is outside the range, which is Age < 11 OR Age > 18. With the operators swapped every number is accepted into the loop, so it never ends.
Question 4
A DECLARE Pass1, Pass2 : INTEGER
B INPUT Pass1
C INPUT Pass2
D IF Pass1 <> Pass2 THEN
E OUTPUT "Passwords differ"
F ENDIF
Line A — A password can contain letters and symbols, so the variables must be STRING, not INTEGER.
Question 5
A INPUT Email1
B Email2 ← Email1
C WHILE Email1 <> Email2 DO
D OUTPUT "Enter email again"
E INPUT Email2
F ENDWHILE
Line B — Double entry needs the user to type the second copy. Assigning Email1 to Email2 makes them always match, so it should be INPUT Email2.

Student with a class code? Join your class →