Validation: AQA GCSE practice
Checks, authentication and robust programs. 14 questions in the style of the AQA GCSE exam.
Sample questions
A program only accepts a number of tickets from 1 to 6. Which type of validation check is this?
- Presence check
- Format check
- Range check
- Length check
Explain the difference between validation and verification. Give one example of each.
Write a program that reads a username and checks it. The rules are: length 5 to 12 characters inclusive, the first character must be a letter, and every character must be a letter or a digit. Print `Valid` if all rules pass. Otherwise print only the first failing message from this order: `Wrong length`, `Must start with a letter`, `Letters and digits only`.