Note AcademyNote Academy

Computer Science · May / June 2023 · Paper 1 TZ1 SL · Question 8

Adapt for 2027Tracing a loop over an array and stating its purpose is taught, but the IB pseudocode should be rewritten in Python or Java.

IBCS

As printed in the paper

The question as text

8. Given the integer array DATA: DATA [0] [1] [2] [3] [4] [5] 7 21 5 19 6 2 and the following algorithm: K = 5 A = 1 B = 0 while K >= 0 if DATA[K] mod 2 < 1 then A = A * DATA[K] else B = B + 1 end if K = K - 1 end while output(A) output(B)

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 8(a)[4]

  • 8(b)[2]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.