AS · Practice questions · Validation and verification

Check it twice.

Six original Cambridge-style questions on validation and verification, including a check digit calculation, a parity block and a validation routine in 9618 pseudocode.

Original questions All questions on this page are original work, written in the Cambridge AS & A Level style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Reasonable, then exact.

01
Explain
[2 marks]

Explain the difference between validation and verification.

  • Validation is an automatic check by the computer that data is reasonable / meets set rules before it is accepted. ✓
  • Verification checks that data has been copied or transferred accurately, matching the original source. ✓
02
Apply
[4 marks]

A library system records a member ID (format: one letter then five digits), a date of birth and the number of books borrowed (0 to 8). Name and describe a different validation check suitable for each of the three fields, and say why validation alone cannot ensure the data is correct.

  • Member ID: format check, first character a letter and the next five digits (or length check of exactly 6 characters). ✓
  • Date of birth: range check, for example between 1 January 1910 and today's date (or presence check). ✓
  • Books borrowed: range check from 0 to 8. ✓
  • Validation only checks data is reasonable; a valid but wrong value (e.g. 3 instead of 5) is still accepted. ✓
03
Calculate
[3 marks]

A code uses a modulo 11 check digit with weights 5, 4, 3, 2 for the four data digits. (a) Calculate the check digit for 5073. (b) The code is typed as 50373. Show whether it is accepted.

  • (a) 5 × 5 + 0 × 4 + 7 × 3 + 3 × 2 = 25 + 0 + 21 + 6 = 52; 52 MOD 11 = 8. ✓
  • Check digit = 11 − 8 = 3, giving 50733. ✓
  • (b) 25 + 0 + 9 + 14 + 3 = 51 using weights 5, 4, 3, 2, 1; 51 MOD 11 = 7, not 0, so the code is rejected. ✓
04
Data
[3 marks]

Data is sent using even parity in a parity block. Bit 1 of each byte is the parity bit. The block received is:

Byte 110110100
Byte 201100110
Byte 311010000
Parity byte00000110

Identify the bit that is in error and give the corrected byte.

  • Bytes 1, 2, 3 contain 4, 4 and 3 ones: byte 3 fails the even parity check. ✓
  • Count each column including the parity byte: only column 6 has an odd number of 1s (1, 1, 0 and parity bit 1 = three). ✓
  • The error is byte 3, bit 6: received 0, so byte 3 should be 11010100. ✓
05
Write
[5 marks]

Write pseudocode to input a password and keep asking until it has a length of at least 10 characters and the user then enters the same password a second time. Output a suitable message for each failure.

  • DECLARE Password, Repeat : STRING and a BOOLEAN flag, e.g. Done ← FALSE. ✓
  • REPEAT ... UNTIL Done (or an equivalent condition-controlled loop). ✓
  • INPUT Password; IF LENGTH(Password) < 10 THEN OUTPUT a length message (length check). ✓
  • ELSE INPUT Repeat; IF Repeat = Password THEN Done ← TRUE (double entry verification). ✓
  • ELSE OUTPUT a mismatch message; ENDIF statements correctly closed. ✓
06
Analysis
[3 marks]

A file is transferred with a checksum and every byte also has a parity bit. Explain why an error could still go undetected.

  • Two bits changing in the same byte leave the number of 1s even (or odd), so the parity check passes. ✓
  • Errors in two bytes could cancel out in the sum, e.g. one byte 1 higher and another 1 lower, giving the same checksum. ✓
  • If both happen together, the corrupted data is accepted, so integrity is lost without warning. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.