← IGCSE Computer Science Paper 2

Drawing a structure diagram from a scenario

Name the whole problem in the top box, then split it into sub-problems level by level until each box is one simple task. Use clear box names.

Understanding Drawing a structure diagram from a scenario in IGCSE Computer Science Paper 2

What it does: Add 1 to score is already one simple task, so it needs no further boxes. Splitting only as far as needed keeps the diagram clear. The name starts with a verb and describes one job. This is better than a vague name such as Stuff or Part 2. The top box names the whole problem. Each level below splits it into smaller sub-problems. Clear box names say exactly what the task does. Vague names like 'Do stuff' tell you nothing. Boxes on a lower level are the parts that together solve the box above them.

Common mistakes: The top box must name the whole problem clearly. 'Program' is too vague. It should be something like 'Quiz game'. 'Do things' is not a clear box name. A box should say exactly what the task is, such as 'Wash clothes'.

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 107–118) and word search (Modules 94–118).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Where do you write the name of the whole problem when drawing a structure diagram?
In the top boxIn the bottom boxes
Matches
Washing machine -> Do things, Other stuff, Part 3
↓
The box names are vague, so nobody can tell what each sub-problem does. Use clear names such as Fill drum, Wash clothes and Spin dry.
Applying
Meanings
Term
top-down design
Meaning
Name the whole problem in the top box, then split it into sub-problems level by level until each box is one simple task. Use clear box names.
Practice
Washing machine program
Testing
Gaps
FillDrum
Check Answer
Spots
1Program
2 Ask questions

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

The 'Wolverine' badge — Fearless Coder, 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. Where do you write the name of the whole problem when drawing a structure diagram?
A. In the bottom boxes
B. In the top box ✓
The top box names the whole problem. Each level below splits it into smaller sub-problems.
2. A washing machine program is the top box. Which is a sensible box on the next level down?
A. Fill drum with water ✓
B. Washing machine
Level 2 holds sub-problems such as filling, washing, rinsing and spinning. 'Washing machine' is the whole problem, so it belongs in the top box.
3. Which box name is clearer for a quiz game with scoring?
A. Add 1 to score ✓
B. Do stuff
Clear box names say exactly what the task does. Vague names like 'Do stuff' tell you nothing.
4. When do you stop splitting a box in a structure diagram?
A. When the box is one simple task ✓
B. When the diagram fills the page
Split only as far as needed. Stop when each box is one simple task that is easy to code.
5. How should you build a structure diagram from a scenario?
A. Start with the smallest tasks at random
B. Start at the top and split level by level ✓
This is top-down design: whole problem first, then sub-problems, level by level.

Match the Pairs

Washing machine control program (top box) → The whole problem is named in the top box of the structure diagram before it is split into sub-problems
Quiz game -> Ask questions, Check answers, Update score → The whole problem is split into three sub-problems on the next level down
Keep splitting a box until it is one simple task, then stop → Update score -> Add 1 to score (stop here)
Use a clear box name that says what the box does → Fill drum with water
Washing machine -> Do things, Other stuff, Part 3 → The box names are vague, so nobody can tell what each sub-problem does. Use clear names such as Fill drum, Wash clothes and Spin dry.
Quiz game -> Add 1 to score -> Press the + key -> Move finger to key → The diagram is split too far. Add 1 to score is already a simple task, so splitting it further adds nothing useful.

Key Term

top-down design
Name the whole problem in the top box, then split it into sub-problems level by level until each box is one simple task. Use clear box names.

Fill in the Blanks

1. PROCEDURE WashingMachine CALL FillDrum CALL Spin
Hint: Type the keyword that runs a sub-problem from the top box.
2. CALL AskQuestion CALL CheckAnswer PROCEDURE CheckAnswer
Hint: Type the sub-problem name that matches the box already called above.
3. PROCEDURE Spin OUTPUT "Drum spinning" ENDPROCEDURE
Hint: Type the keyword that closes a procedure for one simple task.
4. PROCEDURE AddScore score ← score + 10 ENDPROCEDURE
Hint: Type the pseudocode assignment symbol.
5. PROCEDURE QuizGame CALL AskQuestion CALL AddScore
Hint: Type the keyword that starts the top box, the whole quiz problem.

Spot the Error

Question 1
A Program
B Ask questions
C Check answers
D Show final score
Line A — The top box must name the whole problem clearly. 'Program' is too vague. It should be something like 'Quiz game'.
Question 2
A Washing machine program
B Fill drum with water
C Do things
D Spin and drain
Line C — 'Do things' is not a clear box name. A box should say exactly what the task is, such as 'Wash clothes'.
Question 3
A Quiz game
B Ask questions
C score = score + 1
D Show final score
Line C — Box names in a structure diagram describe tasks in plain words. They are not lines of code. It should be 'Update score'.
Question 4
A Washing machine program
B Rotate valve by 1 degree
C Wash clothes
D Drain and spin
Line B — This is far too detailed for a level 2 box. Split only as far as needed, so keep the box at the sub-problem level: 'Fill drum'.
Question 5
A Spin cycle
B Fill drum
C Wash clothes
D Spin dry
Line A — The top box must name the whole problem, but 'Spin cycle' covers only one part. It should be 'Washing machine program'.

Student with a class code? Join your class →