Cambridge O Level Computer Science 2210 · 7.5 Validation and verification checks

Q23 · 2210/23/O/N/22 Q3

Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 4 of 8.

Q232210/23/O/N/22original Q3Structured · 9 marks
Question 3 from 2210/23/O/N/22

Worked solution

(a)(i)

Add the digits: 6 + 9 + 3 + 2 + 1 = 21. Divide by 10: the remainder is 1.

Write: 1 [1]

(a)(ii)

Work out the check digit for each first five digits and compare it with the last digit.

A: 1 + 2 + 3 + 4 + 5 = 15, remainder 5. Last digit 5, correct.

B: 6 + 9 + 1 + 4 + 0 = 20, remainder 0. Last digit 0, correct.

C: 7 + 2 + 2 + 8 + 5 = 24, remainder 4. Last digit 5, incorrect.

D: 2 + 3 + 1 + 2 + 0 = 8, remainder 8. Last digit 0, incorrect.

Write: C [1]

Write: D [1]

(b)(i)

Any change that keeps the sum of the digits the same is not found.

Two or more digits are entered the wrong way round [1]

This is called transposition, for example 12345 typed as 21345 still gives the same check digit [1]

(b)(ii)

Make each digit count differently.

Multiply each digit by a different number (such as its place value) [1]

Then add the results together and divide by a number to find the remainder [1]

(c)

Any two of these checks:

Length check [1]

Type check (or presence check or format check) [1]

KEY IDEAA simple sum check cannot spot swapped digits; weighting each digit fixes this.
TOTAL 9 marks

Official mark scheme

Mark scheme for 2210/23/O/N/22 question 3
VIDEO
▶ Topic lesson

A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.