What data validation is and why it matters

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

What data validation is and why it matters

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which best describes data validation?
A An automatic check that data entered is reasonable and allowed
B Making sure the data is true by asking someone else
2. A student types 250 into an Age cell for a Year 7 class. What should validation do?
A Accept it because 250 is a number
B Reject it because 250 is an impossible age
3. Which is an example of a validation check?
A Only allowing scores between 0 and 100
B Sorting scores from highest to lowest
4. What does 'garbage in, garbage out' mean?
A Deleting old data makes a spreadsheet faster
B Bad data going in gives bad results coming out
5. Which is the difference between validation and verification?
A Validation checks data is reasonable; verification checks it matches the original source
B Validation checks it matches the original source; verification checks it is in range

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1validation ATyped 'abc' into a Score field -> average is wrong
2verification BAge must be between 11 and 14
3Validation catches an impossible value, like a student age of 150 when the allowed range is 11 to 14 CWithout validation, a typo like 1750 instead of 175 is accepted. A range check would have rejected it.
4Garbage in, garbage out means bad data entered gives bad results, so validation helps keep it clean DValidation only checks data is reasonable and allowed, not that it is correct. Verification against the source is needed to catch this typo.
5Height (cm): 1750 accepted, because the cell has no validation EAn automatic check that data is reasonable and allowed when it is entered, like being in range or the right type
6Validation proves 'Jorda' is the correct spelling of the student's name Jordan FChecking that data matches the original source, such as re-reading what you typed against the survey form

Definitions

validation

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF age < 0 __ age > 120 THEN DISPLAY "Invalid age" END IF
2.
=IF(___(B2>=0,B2<=100),"OK","Check")
3.
REPEAT INPUT score _____ score >= 0 AND score <= 100
4.
IF NOT ________(age) THEN DISPLAY "Enter a number" END IF
5.
IF mark _ 100 THEN DISPLAY "Mark is impossible" END IF

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A min ← 19
B max ← 18
C INPUT age
D IF age < min OR age > max
E SHOW 'Out of range'
Question 2
A INPUT score
B IF score is a number
C SHOW 'Numbers only'
Question 3
A INPUT height
B IF height > 0 AND height < 250
C REJECT height
D ELSE
E REJECT height
Question 4
A INPUT email1
B INPUT email1
C IF email1 = email2
D SHOW 'Email confirmed'
Question 5
A INPUT mark
B IF mark < 0 OR mark > 100
C SHOW 'Mark must be 0-100'
D ACCEPT mark
E ELSE
F ACCEPT mark

Answer Key

What data validation is and why it matters
Section A: Quick Questions
Q1
A — An automatic check that data entered is reasonable and allowed
Q2
B — Reject it because 250 is an impossible age
Q3
A — Only allowing scores between 0 and 100
Q4
B — Bad data going in gives bad results coming out
Q5
A — Validation checks data is reasonable; verification checks it matches the original source
Section B: Match the Pairs
Q1
validation → An automatic check that data is reasonable and allowed when it is entered, like being in range or the right type
Q2
verification → Checking that data matches the original source, such as re-reading what you typed against the survey form
Q3
Validation catches an impossible value, like a student age of 150 when the allowed range is 11 to 14 → Age must be between 11 and 14
Q4
Garbage in, garbage out means bad data entered gives bad results, so validation helps keep it clean → Typed 'abc' into a Score field -> average is wrong
Q5
Height (cm): 1750 accepted, because the cell has no validation → Without validation, a typo like 1750 instead of 175 is accepted. A range check would have rejected it.
Q6
Validation proves 'Jorda' is the correct spelling of the student's name Jordan → Validation only checks data is reasonable and allowed, not that it is correct. Verification against the source is needed to catch this typo.
Section C: Definitions
Q1
validation — An automatic check that data is reasonable and allowed when it is entered, such as being in range or the right type, so typos and impossible values are caught.
Section D: Fill in the Blanks
Q1
IF age < 0 OR age > 120 THEN DISPLAY "Invalid age" END IF
Q2
=IF(AND(B2>=0,B2<=100),"OK","Check")
Q3
REPEAT INPUT score UNTIL score >= 0 AND score <= 100
Q4
IF NOT ISNUMBER(age) THEN DISPLAY "Enter a number" END IF
Q5
IF mark > 100 THEN DISPLAY "Mark is impossible" END IF
Section E: Spot the Error
Q1
A — The minimum age for the range check is 11. Setting it to 19 makes the minimum bigger than the maximum, so every age would be rejected. It should be min ← 11.
Q2
B — Validation should show the error message when the score is NOT a number. As written, it complains about correct data. It should be IF score is not a number.
Q3
C — When the height passes the range check, it is reasonable data and should be accepted. Rejecting it here is wrong. It should be ACCEPT height.
Q4
B — Verification asks the user to enter the data twice and compares the two entries. The second entry must go into email2. If both are stored in email1, the check is always true and verifies nothing.
Q5
D — An impossible mark such as 150 must be rejected after the error message is shown. Accepting it lets bad data in. Line 4 should be REJECT mark.