Professional Documents
Culture Documents
Validation:
Validation is an automatic check performed by a program to ensure that the data entered is
sensible and reasonable before it is accepted by the system.
Validation check is assigned to a data field by giving appropriate field attributes and
validation rules.
It does not check the accuracy of data
Example: Presence check, type check, range check, format check etc.
Verification:
Verification is a process performed to ensure that the data entered into a computer or
transferred from one system to another exactly matches with the original data.
Verification is done either manually by visual check called Proof-reading or automatically by
software called Double-entry method, where the same data is entered twice and the two
copies are compared with each other.
During data transmission, verification is done automatically by software using different error
detection methods.
Example: Proof-reading, Double-entry method, Parity check, Checksum, echo check etc.
It is used when we need to ensure that the data entered is sensible, reasonable and consistent;
accepted only if it falls within the set rules. It does not check the accuracy of data.
It is used when we need to ensure that the data entered exactly matches the original source. It
is done by either proof reading or double entry method.
Describe the following how the following Validation check works and give an example
of its usage.
Like "dd/mm/yyyy" or
Date
Checks that the data is in the right "dd.mmm.yyyy"
Format
'Date' format. Example : 24/03/1968 or 24
check
Mar.1968
Length Checks that the data isn't too short A Password which needs to be
check or too long. minimum six letters long.
List check
(or) Checks that the data is in the List or List of subjects of a particular
Look up Table. grade.
table
Range Checks that a value falls within the Student’s Marks mush be -
check specified range. “Between 0 and 100”
Q4. A programmer has written a routine to store the name, email address and
password of a contributor to a website’s discussion group.
a) The programmer has chosen to verify the name, email address and
password.
Explain why verification was chosen and describe how the programmer would verify this
data.
To ensure the accuracy of input data; make sure that they entered the data what they
intended, without mistake.
The programmer could ask the contributor to type in each detail twice and then check that
both values are equal. If they are not equal then the input should be rejected.
b) The programmer has also decided to validate the email address and the password.
Describe validation checks that could be used for –
Email address-
Format check - to check for @ symbol that separates the mail address and domain
name / no space is allowed (white or blank).
Uniqueness check - to check and ensure that it should not match with other's email
address.
Length check - to check and ensure that it should not contain more than 254 characters.
Password-
Length check - to check if its length is minimum 8 characters.
Format check - to check if it contains a mixture of lower and upper-case letters, at least
one digit (0 to 9) and one special character or symbol.
Presence check - to ensure that the field should not be left empty.
Telephone number-
Length or Range check - validation to check if the number contains 7-digits; must be
between 1000000 and 9999999.
Check digit - verification to ensure the accuracy of input data; the last one digit of the
number is used to check that the other digits are correct.
Pupil's name
Length check - validation to check if the length of name is less than or equal to 30
characters.
Visual check - verification to ensure the accuracy of input data; ask the user to check the
name displayed on screen and confirm that it is correct.
Part number
Format check - validation to check if the input data is in appropriate format with 3
characters and 3 digits.
Double-entry - verification to ensure the accuracy of input data; ask the user to type in the
number twice and then check that both the values are equal.
Q6. Write a pseudocode algorithm using pseudocode for range check validation to be used
on entry of marks. If the input mark is out of range between 0 and 100 (inclusive), then
produce an error message and ask to re-enter the mark.
REPEAT
INPUT "Enter the student's mark - ", StudentMark
REPEAT
INPUT "Enter the password between 8 and 12 characters in length - ", Password
Q8. Write an algorithm using pseudocode for type check validation to be used on entry of
mark, to check if it is in whole number (data type, integer). If it is in decimal (data type,
real), then it should be rejected with error message.
REPEAT
INPUT "Enter the mark in whole number - ", Mark
Q9. Write an algorithm using pseudocode for presence check validation to be used on entry
of student ID, to check that some data has been entered and the value has not been left
blank. If it is left blank, then it should be rejected with error message.
REPEAT
INPUT "Enter the student's ID - ", StdID