← Cambridge IGCSE

Validation: Cambridge IGCSE practice

Checks, authentication and robust programs. 15 questions in the style of the Cambridge IGCSE exam.

Sample questions

A program only accepts a number of tickets from 1 to 6. Which type of validation check is this?

  1. Presence check
  2. Format check
  3. Range check
  4. 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`.