← IGCSE Computer Science Paper 2

Turning a structure diagram into a main flowchart and sub-flowcharts

A flowchart that calls each sub-problem from the structure diagram with a subroutine symbol. Each sub-problem then gets its own separate flowchart.

Understanding Turning a structure diagram into a main flowchart and sub-flowcharts in IGCSE Computer Science Paper 2

What it does: Each bottom-level box is a sub-problem, so each one is drawn as a separate flowchart with the same name as its box. The main flowchart uses a subroutine symbol for each call. A diamond is only for decisions. Using the same names links the flowcharts to the structure diagram, so nothing gets lost.

Common mistakes: In the main flowchart every bottom-level box from the structure diagram is called with the subroutine symbol (a rectangle with double side lines). A plain process rectangle is wrong, so line 3 should be [| MarkAnswers |]. The sub-flowchart for the GetMarks box must finish with an end terminator. Line 4 should be ( END ), not a second start.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 123–134) 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.

Learning
Duo
In a main flowchart, how is each sub-problem from the structure diagram shown?
As a subroutine symbol (rectangle with double side lines) that calls itAs a diamond decision symbol
Matches
Main flowchart: START, rectangle Get Marks, rectangle Calculate Grade, END
↓
The sub-problems are drawn as ordinary process rectangles instead of subroutine symbols, so they are not calls to separate flowcharts
Applying
Meanings
Term
main flowchart
Meaning
A flowchart that calls each sub-problem from the structure diagram with a subroutine symbol. Each sub-problem then gets its own separate flowchart.
Practice
START
Testing
Gaps
Main flowchart: CalcAverage
Check Answer
Spots
2[| GetQuestions |]
3[ MarkAnswers ]

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Space Rabbit' badge — Launch Pad, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. In a main flowchart, how is each sub-problem from the structure diagram shown?
A. As a diamond decision symbol
B. As a subroutine symbol (rectangle with double side lines) that calls it ✓
The main flowchart uses a subroutine symbol for each call. A diamond is only for decisions.
2. A structure diagram has 4 bottom-level boxes. How many separate sub-flowcharts do you draw?
A. 4, one for each bottom-level box ✓
B. 1, which holds all of the boxes together
Each bottom-level box gets its own flowchart. This is what lets you solve one small problem at a time.
3. Which describes the main flowchart?
A. A list of calls to the sub-problems, in order ✓
B. All the detailed steps of every sub-problem in one chart
The main flowchart only calls the sub-problems. The detail goes in the sub-flowcharts.
4. What should the name inside a subroutine symbol match?
A. The name of a box in the structure diagram ✓
B. A new name made up for the main flowchart
Using the same names links the flowcharts to the structure diagram, so nothing gets lost.
5. How does each sub-flowchart begin and end?
A. It has no start or end, because the main flowchart controls it
B. It starts with its sub-problem name and ends with an end terminator ✓
Each sub-flowchart is a complete flowchart with its own start (the sub-problem name) and end.

Match the Pairs

Subroutine symbol labelled Get Marks → A call in the main flowchart that runs the Get Marks sub-problem, which has its own separate flowchart
Main flowchart: START, Get Marks, Calculate Grade, Show Result, END → A main flowchart that is only a list of calls, one subroutine symbol per sub-problem, in order
Every bottom-level box in the structure diagram needs its own flowchart → Boxes: Get Marks, Calculate Grade, Show Result -> Flowcharts: Get Marks, Calculate Grade, Show Result
Check that every box has been drawn by matching each box to a subroutine symbol and a sub-flowchart → Box Show Result -> symbol Show Result in main -> flowchart Show Result drawn, tick
Main flowchart: START, rectangle Get Marks, rectangle Calculate Grade, END → The sub-problems are drawn as ordinary process rectangles instead of subroutine symbols, so they are not calls to separate flowcharts
Structure diagram has 3 bottom boxes but only 2 sub-flowcharts are drawn → One bottom-level box has no flowchart, so the solution is incomplete and that sub-problem is never solved

Key Term

main flowchart
A flowchart that calls each sub-problem from the structure diagram with a subroutine symbol. Each sub-problem then gets its own separate flowchart.

Fill in the Blanks

1. Structure box: CalcAverage Main flowchart: CALL CalcAverage
Hint: Type the keyword that makes the main flowchart call a sub-problem.
2. Bottom-level box: ShowResult Main flowchart: CALL ShowResult
Hint: Type the sub-problem name taken from the structure diagram box.
3. Bottom boxes: GetMarks, CalcAvg, ShowResult Sub-flowcharts to draw: 3
Hint: Type how many sub-flowcharts are needed, one for each bottom-level box.
4. Sub-flowchart for the box GetMarks: It has its own START and END ovals
Hint: Type the terminator that begins every flowchart, including each sub-flowchart.
5. Boxes: GetMarks, CalcAvg, ShowResult Main calls: GetMarks, CalcAvg, ShowResult
Hint: Check the box list and type the sub-problem missing from the main flowchart calls.

Spot the Error

Question 1
A ( START )
B [| GetQuestions |]
C [ MarkAnswers ]
D [| ShowScore |]
E ( END )
Line C — In the main flowchart every bottom-level box from the structure diagram is called with the subroutine symbol (a rectangle with double side lines). A plain process rectangle is wrong, so line 3 should be [| MarkAnswers |].
Question 2
A ( GetMarks )
B / INPUT mark /
C [ total ← total + mark ]
D ( START )
Line D — The sub-flowchart for the GetMarks box must finish with an end terminator. Line 4 should be ( END ), not a second start.
Question 3
A ( END )
B [| ReadTemp |]
C [| FindAverage |]
D ( END )
Line A — A main flowchart must begin with a start terminator. Line 1 should be ( START ), because the main flowchart only ends on the last line.
Question 4
A ( START )
B [| ReadMarks |]
C <> mark >= 50 ?
D [| PrintReport |]
E ( END )
Line C — The main flowchart should only be a list of subroutine calls. A decision like this belongs inside the CalcGrade sub-flowchart. Line 3 should be [| CalcGrade |].
Question 5
A [ START ]
B [| ReadTemps |]
C [| FindHottest |]
D ( END )
Line A — Start and end must be drawn as terminator (rounded) shapes. A process rectangle is the wrong shape. Line 1 should be ( START ).

Student with a class code? Join your class →