2210/22/M/J/22 question 2: worked solution (May/June 2022, paper 22)

Show as 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. Q21 2210/22/M/J/22 original Q2 Structured · 11 marks Worked solution (a) Read each line and compare it with what the algorithm should do. Write the line, the error and the fix. Line 08 PassCheck ← TRUE is wrong, because a password that is too short must fail. Correction: PassCheck ← FALSE [1] Line 12 IF Password <> Password can never be true. Correction: IF Password <> Password2 (or IF Password2 <> Password) [1] Line 18 UNTIL PassCheck OR Attempt <> 3 stops after the first attempt. Correction: UNTIL PassCheck OR Attempt = 3 (or Attempt >= 3) [1] (b) Two checks are used: Type of check 1: validation , a length check [1] Description: checks the number of characters, that the password has at least 8 characters [1] Type of check 2: verification , double entry [1] Description: the password is entered twice and the two entries are compared to see that they are the same [1] (c) Choose two different sets of data. Each reason must follow from the data chosen. For example: Set 1: a short password such as small [1] Reason: it is abnormal data , so it will be rejected by the length check [1] Set 2: password entered, and password entered again [1] Reason: it is normal data , so it will be accepted [1] Any appropriate sets score, if the two sets and the two reasons are different. KEY IDEA Trace each line for what it should do; a length check tests the size of the data, and double entry checks it was typed as meant. TOTAL 11 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.