2210/22/M/J/20 question 4: worked solution (May/June 2020, 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. Q46 2210/22/M/J/20 original Q4 Structured · 6 marks Worked solution (a) Take each pair of inputs in turn. Difference = PointsWon - PointsLost. 1000 or more gives move up, below 0 gives move down, anything else gives keep on trying. A PointsWon of -1 ends the flowchart. PointsWon PointsLost Difference OUTPUT 5000 4474 526 Keep on trying 6055 2000 4055 Well done move up 7900 9800 -1900 Sorry move down 3000 2150 850 Keep on trying -1 6700 PointsWon and PointsLost inputs correct [1] Difference calculations correct [1] OUTPUT messages correct [1] (b) Add an extra decision box before the check for Difference >= 1000. [1] It checks if the difference is greater than 5000 . (Or change the 1000 test to >= 1000 and <= 5000.) [1] If yes, add a new output box 'Fantastic leap up two levels' before the flow line returns to the input. [1] KEY IDEA A new case in a flowchart needs a new decision box placed so the tests are made in the right order. TOTAL 6 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.