← IGCSE Computer Science Paper 2

Why decomposition helps: easier to understand and solve

A small part of a bigger problem. It is easier to understand and solve than the whole, so splitting a problem up makes it manageable and makes mistakes easier to find.

Understanding Why decomposition helps: easier to understand and solve in IGCSE Computer Science Paper 2

What it does: Each CALL runs one small sub-problem, so the solution is built one manageable part at a time. If the average is wrong, you only look inside this one short procedure rather than the whole program. Decomposition does not remove the problem. It breaks it into smaller parts that are easier to understand and solve. Decomposition turns one overwhelming task into several manageable ones. Smaller sub-problems make it easier to find where the mistake is.

Common mistakes: In Cambridge pseudocode ELSE has no colon after it. The line should be just ELSE. Checking one small decision like this is easier than checking a whole program. A PROCEDURE must be closed with ENDPROCEDURE, not ENDFUNCTION. Each small sub-problem is a short block, so a mismatch like this is easy to spot.

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 94–106) 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
Why does decomposition make a hard problem easier?
It splits the problem into small sub-problems that are easier to understandIt makes the problem disappear so no code is needed
Matches
Write the whole 500-line program in one go and then test it
↓
This tries to solve the whole problem at once, which feels overwhelming and makes it hard to understand. It should be split into sub-problems and each part solved in turn.
Applying
Meanings
Term
sub-problem
Meaning
A small part of a bigger problem. It is easier to understand and solve than the whole, so splitting a problem up makes it manageable and makes mistakes easier to find.
Practice
// Problem: make a school report
Testing
Gaps
GetMarks()
Check Answer
Spots
2 OUTPUT "Pass"
3ELSE:

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

The 'Star Fox' badge — Frozen Master, 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. Why does decomposition make a hard problem easier?
A. It makes the problem disappear so no code is needed
B. It splits the problem into small sub-problems that are easier to understand ✓
Decomposition does not remove the problem. It breaks it into smaller parts that are easier to understand and solve.
2. A student must write a program for a whole school timetable and feels overwhelmed. What should they do first?
A. Break it into small sub-problems, such as rooms, teachers and classes ✓
B. Write all the code at once and hope it works
Splitting a big problem into smaller parts stops it feeling overwhelming and gives clear steps to follow.
3. Which statement about a sub-problem is true?
A. It is easier to understand and solve than the whole problem ✓
B. It is always harder to solve than the whole problem
A sub-problem is a small part of the bigger problem, so it is simpler to think about and solve.
4. A program with 500 lines gives the wrong answer. When it is split into 5 sub-problems, where is the mistake easier to find?
A. Somewhere in all 500 lines, so every line must be checked
B. In the one small sub-problem that gives the wrong result ✓
With decomposition you can check each sub-problem on its own, so you only search a small part of the program.
5. Which approach follows 'solve one small part at a time'?
A. Solve and test the sub-problem for the score, then move on to the next ✓
B. Try to solve every part of the problem at the same moment
Solving one small part at a time keeps your thinking focused and makes progress easy to see.

Match the Pairs

sub-problem → A small part of a bigger problem that is easier to understand and solve than the whole problem
decomposition → Breaking a big problem into smaller sub-problems so that it becomes manageable
Solve one small part at a time instead of the whole problem at once → CALL EnterScores() CALL CalculateAverage() CALL ShowResult()
A mistake is easier to find because you only need to check one small sub-problem → PROCEDURE CalculateAverage() Average ← Total / Count ENDPROCEDURE
Write the whole 500-line program in one go and then test it → This tries to solve the whole problem at once, which feels overwhelming and makes it hard to understand. It should be split into sub-problems and each part solved in turn.
The program gives the wrong answer, so check every line of the whole program → With one big block of code the error could be anywhere. With sub-problems you check each small part and find the faulty one quickly.

Key Term

sub-problem
A small part of a bigger problem. It is easier to understand and solve than the whole, so splitting a problem up makes it manageable and makes mistakes easier to find.

Fill in the Blanks

1. CALL GetMarks() CALL AddMarks() CALL ShowResult()
Hint: Type the keyword that runs a procedure, so the main program can start one small sub-problem.
2. PROCEDURE ShowResult() OUTPUT Total ENDPROCEDURE
Hint: Type the keyword that closes the procedure holding this one small sub-problem.
3. FUNCTION AddMarks() RETURNS INTEGER RETURN Maths + English ENDFUNCTION
Hint: Type the keyword that states the data type this small part sends back to the main program.
4. PROCEDURE GetMarks() INPUT Maths ENDPROCEDURE
Hint: Type the keyword that starts a named block of code solving one sub-problem.
5. CALL GetMarks() OUTPUT Maths CALL AddMarks()
Hint: Type the keyword that displays a value, so you can check one part works before moving on.

Spot the Error

Question 1
A IF Mark >= 50 THEN
B OUTPUT "Pass"
C ELSE:
D OUTPUT "Fail"
E ENDIF
Line C — In Cambridge pseudocode ELSE has no colon after it. The line should be just ELSE. Checking one small decision like this is easier than checking a whole program.
Question 2
A PROCEDURE GetMarks()
B INPUT Mark
C ENDFUNCTION
Line C — A PROCEDURE must be closed with ENDPROCEDURE, not ENDFUNCTION. Each small sub-problem is a short block, so a mismatch like this is easy to spot.
Question 3
A FUNCTION Avg() RETURN REAL
B RETURN Total / 3
C ENDFUNCTION
Line A — The function header needs the keyword RETURNS (with an S) before the data type. It should be FUNCTION Avg() RETURNS REAL.
Question 4
A FOR Count ← 1 TO 3
B INPUT Mark
C Total ← Total + Mark
D ENDFOR
Line D — A FOR loop in Cambridge pseudocode ends with NEXT and the counter name, so the line should be NEXT Count. ENDFOR is not a pseudocode keyword.
Question 5
A INPUT Mark
B Bonus = Mark DIV 10
C OUTPUT Bonus
Line B — Assignment uses the arrow ←, not =. The = sign is used to compare values. The line should be Bonus ← Mark DIV 10.

Student with a class code? Join your class →