Desk checking an algorithm that calls a function
Trace by hand: record each function call's argument values, follow its statements to the return, then carry the returned value back into the caller's trace table.
Understanding Desk checking an algorithm that calls a function in QCE Digital Solutions Unit 4
What it does: The argument 50 in the caller is copied into the parameter price, so the function trace table starts with price = 50. The variable a is local to area(). The caller's table only receives the returned value, not the column a. Every call has its own arguments and may return a different value. Record each call separately.
Common mistakes: The function prints the value instead of returning it, so there is no returned value to carry back into the caller's trace table and total would be None. It should be 'return result'. c is not a parameter or a local variable, so it has no column in the function's trace table. The function should use its own parameters: 'return 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 127–333) and word search (Modules 127–401).
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
desk checkFill in the Blanks
Spot the Error
Student with a class code? Join your class →