2210/23/O/N/23 question 8: worked solution (October/November 2023, paper 23)

Show as plain text

Cambridge O Level Computer Science 2210 · 7.7 Trace tables Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 6 of 8. Q58 2210/23/O/N/23 original Q8 Structured · 8 marks Worked solution (a) Accept counts Y inputs and Reject counts the others. The algorithm stops asking when Accept reaches 10. Then Reject is 2, which is more than 1, so Error = 2 / 10 × 100 = 20. Accept Reject PartOK Error OUTPUT 0 0 1 Y 2 Y 3 Y 1 N 4 Y 5 Y 6 Y 7 Y 2 N 8 Y 9 Y 10 Y 20 Too many rejected 20% error Accept column correct [1] Reject column correct [1] PartOK column correct [1] Error column correct [1] OUTPUT column correct [1] (b) Write: Put the change after the INPUT box and before the first decision [1] Insert a new process box there [1] In it, convert the input to upper case [1] Or change the first decision box so it also accepts 'y' by adding OR PartOK = 'y' (this way scores the same three marks). KEY IDEA Trace only the boxes the flowchart reaches, and test for both cases of a letter when input could be either. TOTAL 8 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by O/Alevel CS by Wasiq. Tap the picture to open it on YouTube.