2210/22/O/N/23 question 2: worked solution (October/November 2023, paper 22)
Show as plain textHide plain text
Cambridge O Level Computer Science 2210 · 7.5 Validation and verification checks Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 4 of 8. Q26 2210/22/O/N/23 original Q2 Structured · 7 marks 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 IDEA A format check tests the pattern of the data; a length check tests how many characters there are. TOTAL 7 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Paper solver.. Tap the picture to open it on YouTube.