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

Q26 · 2210/22/O/N/23 Q2

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

Q262210/22/O/N/23original Q2Structured · 7 marks
Question 2 from 2210/22/O/N/23

Worked solution

(a)

Write: format check [1]

(b)

Give one value that follows the dd/mm/yyyy style and one that does not, with a reason each.

Normal data: 30/12/1960 [1]

Reason: it is written in the correct dd/mm/yyyy format, so it should be accepted [1]

Abnormal data: 30/Dec/1960 [1]

Reason: the month is not written as two digits, so it should be rejected [1]

(c)

A length check counts the characters entered.

The date must have exactly 10 characters (dd/mm/yyyy with two slashes) [1]

If it is too long or too short it is rejected [1]

KEY IDEAA format check tests the pattern of the data; a length check tests how many characters there are.
TOTAL 7 marks

Official mark scheme

Mark scheme for 2210/22/O/N/23 question 2
VIDEO
▶ Whole paper

Video solution of the whole paper · by Paper solver.. 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.