2210/22/M/J/25 question 4: worked solution (May/June 2025, 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. Q34 2210/22/M/J/25 original Q4 Structured · 7 marks Worked solution (a) Write that a verification check makes sure the data was entered correctly: To check that the value entered has not changed or been mistyped on input (it matches the original) [1] (b) Use one loop to input the numbers and a second loop to input them again and compare. One correct answer: FOR Index ← 1 TO 10 INPUT Numbers[Index] NEXT Index FOR Index ← 1 TO 10 INPUT CheckNumber IF CheckNumber <> Numbers[Index] THEN OUTPUT CheckNumber, " and ", Numbers[Index], " do not match. Please re-enter the number." INPUT Numbers[Index] ENDIF NEXT Index OUTPUT "The check has been completed." At least one appropriate working loop [1] First inputs of all 10 numbers stored in Numbers[] [1] Correct second input made for each number [1] Working selection statement that compares the first and second inputs one at a time [1] If they do not match, output both values and a message asking for re-entry [1] New input stored in the current array location, replacing the old one [1] A final message after the loops saying the check is completed is also a mark point, but the question is marked out of 6. KEY IDEA Double entry means typing the data twice and comparing the two entries. TOTAL 7 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.