Computer Science · Oct / Nov 2025 · Paper 1 SL · Question 5
Adapt for 2027Tracing a loop that updates an array is taught, but the IB pseudocode should be rewritten in Python or Java.
IBCS
As printed in the paper
The question as text
5. Consider the following integer array, NUM: NUM [0] [1] [2] [3] [4] 7 1 5 9 6 and the following algorithm: K = 0 loop while K < 4 K = K + 1 NUM[K] = NUM[K-1] + NUM[K] end loop NUM[0] = NUM[K] + NUM[0] Copy and complete the following trace table: [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.

