Computer Science · Oct / Nov 2021 · Paper 22 · Question 5
2210
As printed in the paper
The question as text
The flowchart represents an algorithm. The algorithm will terminate if –1 is entered at the List input. START List1 ← 0 List2 ← 0 END INPUT List Yes No No No No Yes Yes Yes INPUT Value OUTPUT "Input Error" OUTPUT "List 1 = ", List1 OUTPUT "List 2 = ", List2 IS List = –1 ? IS List = 1 ? IS List = 2 ? OUTPUT "List 2 is greatest" OUTPUT "List 1 is greatest" IS List1 > List2 ? List2 ← List2 + Value List1 ← List1 + Value 11 Complete the trace table for the algorithm using this input data: 2, 77, 2, 16, 1, 35, 2, –7, 5, 18, 1, 11, 1, 12, 2, 20, –1, 18 List Value List1 List2 OUTPUT [5]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

