Writing a main program that calls one procedure per sub-problem
Runs a procedure. A main program is a short list of CALL lines, one per sub-problem from the structure diagram, in the right order, with no detail inside it.
Understanding Writing a main program that calls one procedure per sub-problem in IGCSE Computer Science Paper 2
What it does: Three sub-problems in the structure diagram give three CALL lines. The detail of each step lives inside its own procedure. GetInputs comes before Calculate because Calculate needs the input values. Reversing them would use values that do not exist yet. The main program calls one procedure per sub-problem, in the order the work must happen: inputs first, then the calculation, then the results. The keyword CALL comes first, followed by the procedure name. CALL Calculate runs the procedure. The second version puts detail (INPUT and OUTPUT) directly in the main program. The detail should be inside GetInputs and ShowResults instead.
Common mistakes: Each sub-problem in the main program needs the keyword CALL. It should be CALL GetInputs, otherwise the procedure is not run. Pseudocode keywords must be written in capitals. The line should be CALL ShowResults.
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
CALLFill in the Blanks
Spot the Error
Student with a class code? Join your class →