Tracing a program that calls a procedure
A table used to trace a call: record the value given to each parameter, follow the procedure's statements, then return to the next line of the main program.
Understanding Tracing a program that calls a procedure in IGCSE Computer Science Paper 2
What it does: Each call gives the parameter a new value, so each call is traced separately. Total is declared and set inside the procedure, so it does not keep its value from an earlier call. Output appears in the order the statements run. The procedure runs at the CALL, before the main program continues to the next line. Arguments are matched to parameters in order. The first value goes to the first parameter, and the second value goes to the second. The first row of the trace table records the argument value: Num = 3.
Common mistakes: The trace table has a column for the parameter N, which gets the value 4 from the call. M is never declared or given a value, so the line should be R ← N * 2. Assignment puts the value on the right into the variable on the left. When tracing, Sum must be given A + B (2 + 3 = 5), so the line should be Sum ← A + B.
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 419–428) and word search (Modules 419–438).
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 →