Cambridge O Level Computer Science 2210 · 7.7 Trace tables

Q50 · 2210/22/O/N/21 Q5

Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 6 of 8.

Q502210/22/O/N/21original Q5Structured · 5 marks
Question 5 from 2210/22/O/N/21

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".

ListValueList1List2OUTPUT
00
2
7777
2
1693
1
3535
2
-786
5
18Input Error
1
1146
1
1258
2
20106
-1List 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 IDEAFollow the flowchart one box at a time and change only the variable that the decision sends you to.
TOTAL 5 marks

Official mark scheme

Mark scheme for 2210/22/O/N/21 question 5
VIDEO
▶ Topic lesson

A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.