Worksheet - Validation and Verification
Worksheet - Validation and Verification
Task 1:
Identify the appropriate validation method that has been used in the given scenarios:
a)
b)
c)
d)
e)
Extension: For the question (a) to (e) apart from what you have identified, is there any possibility of using
another validation method? If so, describe where you can use and justify your answer.
Task 2:
Complete the following table by explaining how each validation method works and give an example for
each.
Range Check
Length Check
Type Check
Format Check
Presence Check
Check Digit
Task 3:
Choose any one among the following scenario and write pseudocode for executing the appropriate
validation check:
1) Write pseudocode to check the age and height of a child who wants to go on a fairground ride. The
age must be over 7 and under 12, the height must be over 110 centimeters and under 150
centimeters. (Level 3)
2) Write pseudocode to check that the length of a password is between 8 and 12 characters inclusive.
(Level 2)
3) Write pseudocode to check whether the test marks entered by a teacher is within the range 1 to 100
inclusive. (Level 1)
Task 4:
1)
Extension:
A hospital holds records of its patients in a database. Four of the fields are
• Date of visit (dd/mm/yyyy)
• Patient height (m)
• 8-digit patient ID
• Contact telephone number
The presence check is one possible type of validation check on the data. For each field, give another
validation check that can be performed. Give an example of data which would fail your named validation
check. A different validation check needs to be given for each field.
Date of visit
Patient’s height
Patient ID
Contact telephone
number
Challenge: