2210/22/O/N/21 question 5: worked solution (October/November 2021, paper 22)
Show as plain textHide 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. Q50 2210/22/O/N/21 original Q5 Structured · 5 marks Worked solution Run the flowchart from START. List1 and List2 start at 0. The List input chooses which total to add Value to: 1 adds to List1, 2 adds to List2, -1 stops, anything else gives "Input Error". List Value List1 List2 OUTPUT 0 0 2 77 77 2 16 93 1 35 35 2 -7 86 5 18 Input Error 1 11 46 1 12 58 2 20 106 -1 List 1 = 58 List 2 = 106 List 2 is greatest List column correct [1] Value column correct [1] List1 column correct [1] List2 column correct [1] OUTPUT column correct [1] The last 18 is never read because -1 stops the algorithm. KEY IDEA Follow the flowchart one box at a time and change only the variable that the decision sends you to. TOTAL 5 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.