How to build and read a trace table, with worked examples for a sequence, a decision and a loop, and how to use one to find a logic error.
5 narrated scenes. Press play, listen and read along — the points appear as they are explained. Use ‹ Prev / Next › or the scene bar to jump to any scene.
A trace table is a paper test: you play the computer, one line at a time. It is how you prove an algorithm works before you run it.
Narration uses your device’s built-in voice. No sound? Switch to “Captions only” — the captions advance on their own.
Step through a loop and fill in the trace table.
Copy these into your notebook in your own words — that is how they stick.
Records variable values step by step.
One per variable, plus condition and output.
One per step or per pass of a loop.
Use the values given; include a boundary.
Program runs but gives a wrong answer.
Testing by hand with a trace table.
Value exactly on a limit, e.g. 50.
Compare to find errors.
3 quick games on this lesson. Earn XP and badges as you play — your best score for each game is saved. Games are for practice and do not change your exam readiness. More games in the Information Technology Arcade.
8 items modelled on real CSEC Paper 1 questions. Choose one answer for each, then check. Aim for 80% or better. Work each item on paper first.
Write full answers, then reveal the mark scheme and tick the points you earned (10 marks in total). Show all your working — method marks count. Your answers are saved on this device.
Question 1 [10 marks]
Consider this algorithm: 1) count ← 1; 2) total ← 0; 3) WHILE count <= 4; 4) total ← total + count * 2; 5) count ← count + 1; 6) ENDWHILE; 7) OUTPUT total.
(a) (a) Complete a trace table with the columns count, total and output. [5]
(b) (b) State the output of the algorithm. [1]
(c) (c) State what a logic error is and how a trace table helps find one. [3]
(d) (d) Give one boundary value that would be used to test a program checking mark >= 50. [1]
Find these in your own past-paper booklets for extra timed practice. Items above are written in the style of these papers; any adapted from a specific question say so.