Note AcademyNote Academy

Computer Science · May / June 2016 · Paper 1 SL · Question 10

Adapt for 2027Tracing a conditional loop with a trace table is on the syllabus, but the code must be rewritten from IB pseudocode into Python or Java.

IBCS

As printed in the paper

The question as text

10. Trace the following fragment, for N=139 and L=3, by copying and completing the trace table given below. D = N div L Z = 1 B = false loop while Z<L D = D div L Z = Z+1 B = NOT B end loop if (D ≠ 0 AND B) then output(D, B) else output(Z, NOT B) end if D Z B Z<L ? output … … … … … [4]

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.