KwickAcademy Course Topics · 7 min · free
Decomposing a problem before coding
Decomposition breaks a big problem into smaller sub-problems that can each be solved, tested and then joined. Abstraction goes with it: remove details that do not matter.
Follows the syllabus of: Edexcel GCSE Computer Science (1CP2)
On screen in this lesson
What is decomposition?
| Break a big problem into smaller sub-problems |
| Each sub-problem is small enough to solve on its own |
| Solve the parts, then join them into one solution |
An everyday example
| Big task: organise the school sports day |
| Sub-task: make the list of events |
| Sub-task: register students for each event |
| Sub-task: record results and print certificates |
Why decompose first?
| The problem feels less scary and easier to understand |
| Each part can be written and tested separately |
| Parts can be shared between people in a team |
| Parts can be reused, often as subprograms |
Input, process, output
| Part | Question | Canteen bill |
|---|---|---|
| Input | What comes in? | items, quantity |
| Process | What is done? | add up prices |
| Output | What goes out? | total bill |
The canteen problem
| Read each item code and how many are ordered |
| Look up the price of each item |
| Add up the total and apply any discount |
| Display the final bill |
Keep breaking down
| Work out total is still quite big |
| Split it: multiply price by quantity |
| Split it: add all the line amounts |
| Split it: subtract a discount if total is over 200 |
Quick answers
What are sub-problems of a class topper program?
Think input, process, output: get marks, find the highest, show the topper.
What is abstraction?
Removing details that do not matter.
KwickClips from this lesson
Short clips, one idea each. Good for revision the night before.
The full lesson, in text
Hello students, welcome to Kwickprep. You are asked to write a program for a school canteen. Where do you even start? Most students open the editor and start typing. Today we will learn a better first step, called decomposition.
Decomposition is a thinking skill used before any code is written. It means breaking a big problem into smaller parts, called sub-problems. Each sub-problem should be small enough to understand and solve by itself. When every part is solved, we join the parts together to solve the whole problem.
You already decompose problems in daily life. Think about organising the school sports day, which feels huge at first. One group makes the list of events. Another group registers students for each event. A third group records results and prints the certificates. Nobody does everything at once, yet the whole day gets done.
Decomposition gives four clear benefits. A big problem feels less scary once you see its parts. Each part can be written and tested on its own, so bugs are easier to find. In a team, different people can work on different parts at the same time. And a part, such as a function, can often be reused in another program.
A simple way to start decomposing is to ask three questions. Input asks, what data comes into the program, such as the items and quantities ordered. Process asks, what must the program do with that data, such as adding up the prices. Output asks, what must the program show at the end, such as the total bill.
Now let us decompose the full canteen problem into steps. First, read each item code and the quantity ordered. Second, look up the price of that item. Third, add up the total, and take off a discount if one applies. Fourth, display the final bill neatly on the screen.
We can draw these parts as a sequence of blocks, one under another. The first block gets the order from the user. The second block finds the price of each item. The third block works out the total. The fourth block shows the bill. Each block is now a small problem we can code.
Sometimes one part is still too big, so we break it down again. Work out total still hides several steps. First, multiply each price by its quantity. Next, add all these line amounts together. Finally, subtract a discount if the total is more than two hundred rupees. Stop breaking down when each step is easy to code.
Pause the video and try one yourself. The task is a program that finds the topper of a class. What are its sub-problems? Use input, process and output to help you. A good answer is: read each name and mark, find the highest mark, then display the topper's name and mark.
In Python, each small part can become its own function, which is a named block of code. The function line total multiplies price by quantity and returns the answer. The function apply discount checks, is the total greater than two hundred? If yes, it returns the total minus twenty. Otherwise it returns the total unchanged.
Now we join the parts into one program. The line total function is reused for each item. Four sandwiches at thirty rupees make one hundred twenty. Two teas at fifteen rupees make thirty. So t, the total, is one hundred fifty. Is one hundred fifty greater than two hundred? No, so there is no discount, and the program prints Bill: one hundred fifty.
Exam questions may show a decomposed design written in pseudocode. The main procedure simply calls one subprogram for each part. Get order, find prices and work out total are each written separately. The main procedure reads almost like the list of steps we planned.
Decomposition is often taught together with another skill called abstraction. Decomposition splits the problem into manageable parts. Abstraction means removing details that do not matter for the solution. For example, the canteen bill needs prices and quantities, but not the colour of the plate. Exam questions often ask you to name and explain both skills.
Here are four tips for exam answers on decomposition. Write each sub-problem clearly on its own line. Make sure each sub-problem does only one job. Show how the parts connect, meaning what data each part takes in and passes on. And always use the context of the question, because a general textbook answer scores fewer marks.
Let us revise what we learned today. Decomposition means breaking a big problem into smaller sub-problems. Input, process and output help you find the parts. Keep breaking a part down until it is easy to code. Each part can become a function or a procedure. Solve and test the parts, then join them into one working program. Next time you get a task, plan the parts before you type a single line.
Courses that teach this
| Course | Unit |
|---|---|
| Edexcel GCSE GCSE Computer Science (1CP2) | Topic 6: Problem solving with programming |
Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.
Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.


