← VCE Software Development U3O1

Validation: why data is checked on entry

An automatic check that data is reasonable and in the right form when entered. It blocks bad data early, but it cannot prove the data is true (a valid age of 15 could still be wrong).

Understanding Validation: why data is checked on entry in VCE Software Development U3O1

What it does: The value 15 passes the rule, so it is valid. It is still wrong, which shows validation cannot prove data is true. A Stop alert rejects the entry completely. A Warning alert tells the user about a possible problem but lets them keep the entry if they choose. Verification checks that data was entered as intended, for example by double entry or comparing to a source. Blocking 'banana' is a validation check on its form. Checking on entry stops bad data early, before it can affect later calculations.

Common mistakes: A range check needs AND so the age must be both at least 10 and at most 18. With OR, every number passes, so the check never blocks bad data. This is a length check. Australian postcodes have exactly 4 digits, so the test should be n = 4. Using n > 4 would accept only longer, invalid entries.

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 114–124) and word search (Modules 114–141).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A form refuses to accept the text 'abc' in an Age box. What is this an example of?
Validation: an automatic check on entryVerification: proving the age is true
Matches
Validation proved the age 15 was true, so no more checking is needed
↓
Validation only checks that data is reasonable and in the right form. It cannot prove the data is true, so a valid age can still be wrong.
Applying
Meanings
Term
validation
Meaning
An automatic check that data is reasonable and in the right form when entered. It blocks bad data early, but it cannot prove the data is true (a valid age of 15 could still be wrong).
Practice
INPUT age
Testing
Gaps
=IF((B2>=10,B2<=18),"Valid","Invalid")
Check Answer
Spots
1INPUT age
2IF age>=10 OR age<=18 THEN

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

The 'Mantis Shrimp' badge — Speed Striker, 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 form refuses to accept the text 'abc' in an Age box. What is this an example of?
A. Validation: an automatic check on entry ✓
B. Verification: proving the age is true
Validation automatically checks that data is reasonable and in the right form when it is entered. It does not prove the data is true.
2. Which statement about validation is correct?
A. It guarantees every entry is true
B. It stops bad data before it spoils later results ✓
Validation catches unreasonable or wrongly formed data early, but it cannot prove that data is true.
3. A student is 15 but types 16 in an Age field. The validation rule is 'whole number from 10 to 18'. What happens?
A. It is rejected because the age is not true
B. It passes validation, but the data is still wrong ✓
16 is a reasonable whole number in range, so it is valid. Validation can't know the real age, so valid data can still be wrong.
4. Which check is verification rather than validation?
A. Typing your email twice to confirm it matches ✓
B. Blocking a date typed as 'banana'
Verification checks that data was entered as intended, for example by double entry or comparing to a source. Blocking 'banana' is a validation check on its form.
5. When is validation applied to data?
A. When the data is entered ✓
B. Only after all the results are calculated
Validation works on entry, so bad data is stopped before it can spoil totals, averages and charts later.

Match the Pairs

Age must be between 10 and 100 → A range check: the system rejects any age outside the allowed range when it is typed in
Please type your email address again → Verification: the user re-enters the data so the two entries can be compared for typing mistakes
Valid but wrong data: a rule can accept an age of 15 even when the person is really 16, because validation only checks that data is reasonable → Age rule: 10 to 100. Typed: 15. Real age: 16. Result: accepted
Rejecting versus warning: a strict rule blocks bad data and a softer rule lets the user continue after a message → Stop: value rejected / Warning: value allowed after a message
Validation proved the age 15 was true, so no more checking is needed → Validation only checks that data is reasonable and in the right form. It cannot prove the data is true, so a valid age can still be wrong.
Check data for errors only at the end, after all the results are worked out → Validation should happen when data is entered. Checking late lets bad data spoil results such as totals and averages before it is caught.

Key Term

validation
An automatic check that data is reasonable and in the right form when entered. It blocks bad data early, but it cannot prove the data is true (a valid age of 15 could still be wrong).

Fill in the Blanks

1. =IF(AND(B2>=10,B2<=18),"Valid","Invalid")
Hint: Type the function that needs both range checks to be true
2. age ← 15 IF age >= 0 AND age <= 120 THEN OUTPUT "Valid"
Hint: Type the comparison operator for the upper limit of a reasonable age
3. IF mark <= 100 THEN OUTPUT "Saved" ELSE OUTPUT "Rejected: 0 to 100 only"
Hint: Type the keyword for what happens when the check fails
4. IF age < 0 OR age > 120 THEN OUTPUT "Warning: check this age"
Hint: Type the logical operator that flags the age if either condition is true
5. =IF(B2=C2,"Match","Re-check")
Hint: Type the operator that compares whether the two typed entries are the same

Spot the Error

Question 1
A INPUT age
B IF age>=10 OR age<=18 THEN
C ACCEPT age
D ELSE
E REJECT age
Line B — A range check needs AND so the age must be both at least 10 and at most 18. With OR, every number passes, so the check never blocks bad data.
Question 2
A INPUT postcode
B n <- LENGTH(postcode)
C IF n > 4 THEN SAVE postcode
D ELSE REJECT postcode
Line C — This is a length check. Australian postcodes have exactly 4 digits, so the test should be n = 4. Using n > 4 would accept only longer, invalid entries.
Question 3
A INPUT name
B IF name <> "" THEN
C SHOW "Name is required"
D ELSE SAVE name
Line B — A presence check should catch an EMPTY entry. With <> the error message would show when a name was typed. It should be IF name = "" THEN.
Question 4
A // typed score 85, real is 58
B IF score >= 0 AND score <= 10
C PRINT "Accepted as valid"
D // Valid does not mean true
Line B — The upper limit of the range check should be 100 so that 85 passes. 85 is valid but still wrong, because validation only checks that data is reasonable and cannot prove it is true.
Question 5
A INPUT height_cm
B IF height_cm < 0 THEN
C WARN "Cannot be negative"
D ELSE IF height_cm > 220 THEN
E WARN "Unusual - check it"
Line C — A negative height is impossible, so it should be rejected, not just warned about. Warnings are for unusual values that could still be true.

Student with a class code? Join your class →