← Years 9–10 Creating Digital Solutions

Decomposing a problem into a hierarchy chart

A diagram that splits one main problem into smaller sub-problems in boxes, level by level, until each box is a small task that can be solved on its own.

Understanding Decomposing a problem into a hierarchy chart in Years 9–10 Creating Digital Solutions

What it does: The sub-problem 'Handle payments' is still fairly big, so it is split again into small tasks. Each of these can be solved on its own, so the splitting can stop. Once a box is a small, self-contained task, it can be coded as its own function. The box name becomes the function name. The top-level box holds the whole problem. Sub-problems then branch out in boxes below it. A sub-problem is a smaller part of the main problem. Repeating the main problem does not break it down. Each level breaks the boxes above it into smaller pieces, so the chart grows downwards in levels.

Common mistakes: A sub-problem must be a smaller part of the main problem. This box just repeats the main problem, so it does not split anything. It should be a part such as 'Choose the music'. Each sub-problem box must be a different part of the main problem. This box repeats 'Make the questions' from line 2, so the marking part is missing. It should be 'Sub: Mark the answers'.

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 6–132) and word search (Modules 6–132).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Where does the main problem go in a hierarchy chart?
In a box at the bottomIn a single box at the top
Matches
Top box: Make a quiz game, Show score, Ask questions, Save high scores
↓
The top box lists several tasks instead of one main problem. 'Make a quiz game' should be alone at the top, with the other tasks as sub-problem boxes below it.
Applying
Meanings
Term
hierarchy chart
Meaning
A diagram that splits one main problem into smaller sub-problems in boxes, level by level, until each box is a small task that can be solved on its own.
Practice
Main: Build a canteen ordering app
Testing
Gaps
Level : Make a quiz app
Check Answer
Spots
1Main: Organise a school disco
2 Sub: Organise a school disco

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

The 'Scorpion' badge — Venom Debugger, 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 does the main problem go in a hierarchy chart?
A. In a box at the bottom
B. In a single box at the top ✓
The top-level box holds the whole problem. Sub-problems then branch out in boxes below it.
2. Which is a sub-problem of the main problem 'Build a quiz app'?
A. Show each question on the screen ✓
B. Build a quiz app
A sub-problem is a smaller part of the main problem. Repeating the main problem does not break it down.
3. How is a hierarchy chart built?
A. Split the problem into sub-problems, level by level ✓
B. Write every small task in one long row with no levels
Each level breaks the boxes above it into smaller pieces, so the chart grows downwards in levels.
4. When should you stop splitting a box into smaller boxes?
A. When the task is small enough to solve on its own ✓
B. When the chart has exactly three levels
There is no fixed number of levels. You stop when each bottom box is a small, solvable task.
5. Which box is still too big to be a bottom-level task in a hierarchy chart for 'Make a school canteen ordering app'?
A. Add up the price of the items in the cart
B. Handle the whole ordering process ✓
'Handle the whole ordering process' has many steps inside it, so it needs splitting further. Adding up prices is one small task.

Match the Pairs

Top box: Run a school canteen app → The top-level problem box that states the one main problem to be decomposed
Run a school canteen app -> Take orders, Handle payments, Show menu → Sub-problems placed as boxes below the main problem, each one a smaller part of it
Keep splitting a sub-problem until each box is a small task that can be solved on its own → Handle payments -> Enter card details, Check funds, Print receipt
A small sub-problem box on the chart can later become a function in the program → Box: Check funds -> def check_funds(balance, price):
Top box: Make a quiz game, Show score, Ask questions, Save high scores → The top box lists several tasks instead of one main problem. 'Make a quiz game' should be alone at the top, with the other tasks as sub-problem boxes below it.
Make a quiz game -> Write the code for everything → The sub-problem 'Write the code for everything' is still too big and is not a small task. It should be split into smaller sub-problems like Ask questions, Check answers and Show score.

Key Term

hierarchy chart
A diagram that splits one main problem into smaller sub-problems in boxes, level by level, until each box is a small task that can be solved on its own.

Fill in the Blanks

1. Level 1: Make a quiz app Level 2: Ask questions Level 2: Show score
Hint: Type the level number of the top-level problem box.
2. Level 1: Make a quiz app Level 2: Ask questions Level 3: Pick one question
Hint: Type the level number for a box that splits a sub-problem into a smaller task.
3. Main problem: Make a quiz app Sub-problem: Ask questions Sub-problem: Show score
Hint: Type the label for the single box at the top of the chart.
4. Box: Show score FUNCTION showScore() PRINT score
Hint: Type the keyword that turns a small sub-problem box into a reusable block of code.
5. IF task is too big THEN split it again ELSE stop and solve it
Hint: Type the keyword for the other choice, when the task is already small enough.

Spot the Error

Question 1
A Main: Organise a school disco
B Sub: Organise a school disco
C Sub: Sell tickets
D Sub: Set up the hall
Line B — A sub-problem must be a smaller part of the main problem. This box just repeats the main problem, so it does not split anything. It should be a part such as 'Choose the music'.
Question 2
A Main: Build a quiz app
B Sub: Make the questions
C Sub: Make the questions
D Sub: Show the score
Line C — Each sub-problem box must be a different part of the main problem. This box repeats 'Make the questions' from line 2, so the marking part is missing. It should be 'Sub: Mark the answers'.
Question 3
A Main: Make a weather app
B Sub: Get weather data
C Task: Build the whole app
D Sub: Display the forecast
Line C — A Task box is where we stop splitting, so it must be small enough to solve on its own. 'Build the whole app' is the original big problem. It should be a small task such as 'Read the city name'.
Question 4
A Main: Run a canteen app
B Sub: Order -> order()
C Sub: Pay -> pay()
D Sub: Pickup -> pay()
Line D — Each sub-problem later becomes its own function, so it needs its own matching name. pay() is already used by the 'Pay' box. The Pickup box should use pickup().
Question 5
A Main: Create a school website
B Sub: Design the pages
C Sub: Write the content
D Sub: Bake a chocolate cake
Line D — Every sub-problem must help solve the main problem. Baking a cake has nothing to do with creating a website. It should be a related part such as 'Test the links'.

Student with a class code? Join your class →