Turning a structure diagram into pseudocode
Each box in a structure diagram becomes a PROCEDURE or FUNCTION named after the box. A box with sub-boxes uses CALL statements to run them. Check that every box has code.
Understanding Turning a structure diagram into pseudocode in IGCSE Computer Science Paper 2
What it does: The parent box becomes a routine whose body is one CALL for each of its sub-boxes, in order. A bottom-level box has no sub-boxes, so it holds the real code. If it produces a value, it is written as a FUNCTION with RETURN. Each box becomes a subroutine named after the box, so the code is easy to match back to the diagram. Calling a procedure needs the CALL keyword followed by its name and brackets. Always check that every box in the diagram has code. A missing box means part of the solution is missing. In Cambridge pseudocode, a sub-box's procedure is run by a CALL statement, so the line should be CALL GetMarks().
Common mistakes: The box name becomes the subroutine name, so the CALL must match it exactly. The procedure is SoundAlarm, so the line should be CALL SoundAlarm(). The top box only calls its sub-boxes and returns no value, so it is a PROCEDURE, which also matches ENDPROCEDURE. The line should be PROCEDURE Main().
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 136–145) and word search (Modules 123–145).
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
PROCEDUREFill in the Blanks
Spot the Error
Student with a class code? Join your class →