Completing a trace table for pseudocode
A table used to dry-run pseudocode: one column per variable plus OUTPUT, and a new row each time a statement changes a value. INPUT values come from the question.
Understanding Completing a trace table for pseudocode in IGCSE Computer Science Paper 2
What it does: This statement changes Total, so Total gets a new value in the table. Other columns stay blank on that row because nothing in them changed. Anything produced by an OUTPUT statement is written in the OUTPUT column, not in a variable column. In an exam, the INPUT values are supplied by the question, so you must use exactly those values in order. An assignment changes a variable, so it needs a row. A comment does nothing and is never traced. OUTPUT sends text to the screen, so it goes in the OUTPUT column. It does not change Total. Headings come from the variables in the algorithm, plus an OUTPUT column. Add a prompt column if the algorithm asks for input.
Common mistakes: Total must add Count to its own old value. Count + Count gives 2, 4, 6 in the Total column instead of 1, 3, 6. It should be Total ← Total + Count. Pseudocode keywords must be in upper case. It should be INPUT Num. The value the question supplies is then written in the Num column of the trace table.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 216–231) and word search (Modules 188–231).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
trace tableFill in the Blanks
Spot the Error
Student with a class code? Join your class →