← IGCSE Computer Science Paper 2

Why decomposition helps: team work and reuse

Different programmers write separate sub-problems at the same time, using their own skills, and finished parts such as a validation subroutine can be reused in other programs.

Understanding Why decomposition helps: team work and reuse in IGCSE Computer Science Paper 2

What it does: A function with a clear purpose and parameter can be called from many programs, which is reuse of a finished part. In a team, each sub-problem can be given to the person who knows that area best, such as a database expert for storage. Using specialists on the parts they know best makes the work quicker and more reliable. A finished, tested subroutine can be reused in other programs. This saves time and avoids writing the same code again. Because each sub-problem has its own job and its own inputs and outputs, the parts can be developed separately and then joined together.

Common mistakes: Cambridge pseudocode starts a procedure with the keyword PROCEDURE, not PROC. This validation part is written once as a subroutine so it can be reused in many programs. A procedure written by a team member is run with the CALL keyword. It should be CALL GetMarks().

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
A school app is split into sub-problems. Which statement about team work is correct?
Different programmers can write different parts at the same timeOnly one programmer can work on the program at a time
Matches
Copy and paste the age check code into every new program
↓
Copying the same code again and again wastes time and risks errors. The check should be one subroutine that is reused.
Applying
Meanings
Term
team work and reuse
Meaning
Different programmers write separate sub-problems at the same time, using their own skills, and finished parts such as a validation subroutine can be reused in other programs.
Practice
// Written by Sam: reusable check
Testing
Gaps
ValidateAge()
Check Answer
Spots
1PROC CheckAge(Age)
2 IF Age < 0 OR Age > 99 THEN

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

The 'Owl' badge — Wise 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. A school app is split into sub-problems. Which statement about team work is correct?
A. Only one programmer can work on the program at a time
B. Different programmers can write different parts at the same time ✓
Once a problem is decomposed, each sub-problem is separate, so team members can write their parts at the same time. This usually saves time.
2. Which is a benefit of decomposition for a team?
A. A specialist can work on the part they know best ✓
B. Every programmer must write every part of the program
Each sub-problem can be given to the person with the right skills, such as one who is good at database work or at screen design.
3. A team needs a screen layout and a database search. Which is the best way to share the work?
A. Give both parts to the same person and have everyone else wait
B. Give each part to the programmer skilled in that area ✓
Using specialists on the parts they know best makes the work quicker and more reliable.
4. A validation subroutine has been written and tested for a school login program. What can the team do with it?
A. Reuse it in other programs that need the same check ✓
B. Delete it, because it can only work in the first program
A finished, tested subroutine can be reused in other programs. This saves time and avoids writing the same code again.
5. Which statement about reusing a subroutine is correct?
A. Reusing a tested subroutine saves development time ✓
B. Every program needs its own newly written copy of the same check
Reuse means the part is already written and tested, so the team does not need to start from scratch.

Match the Pairs

CALL ValidateAge() → Runs a finished validation subroutine that was already written, so it can be reused in a program without rewriting it
Programmer A: PROCEDURE Login() Programmer B: PROCEDURE Report() → Different team members write different sub-problems at the same time
A validation subroutine written once can be reused in many programs → FUNCTION ValidateInput(Value : INTEGER) RETURNS BOOLEAN
A specialist works on the sub-problem that matches their skills → Database expert writes PROCEDURE SaveRecords()
Copy and paste the age check code into every new program → Copying the same code again and again wastes time and risks errors. The check should be one subroutine that is reused.
One programmer writes all of the sub-problems one after another → This does not share the work. Sub-problems should be split between team members so they are written at the same time.

Key Term

team work and reuse
Different programmers write separate sub-problems at the same time, using their own skills, and finished parts such as a validation subroutine can be reused in other programs.

Fill in the Blanks

1. CALL ValidateAge()
Hint: Type the keyword that runs a finished procedure written by a teammate.
2. FUNCTION Check(N : INTEGER) RETURNS BOOLEAN
Hint: Type the data type that a validation function returns (true or false).
3. PROCEDURE ShowMenu() OUTPUT "1. Play 2. Quit" ENDPROCEDURE
Hint: Type the keyword that closes a procedure one team member has written.
4. PROCEDURE CheckAge() ENDPROCEDURE CALL CheckAge()
Hint: Type the name of the procedure being reused in this program.
5. IF Age >= 0 AND Age <= 120 THEN
Hint: Type the logic operator that needs both conditions to be true in a reusable validation check.

Spot the Error

Question 1
A PROC CheckAge(Age)
B IF Age < 0 OR Age > 99 THEN
C OUTPUT "Invalid age"
D ENDIF
E ENDPROCEDURE
Line A — Cambridge pseudocode starts a procedure with the keyword PROCEDURE, not PROC. This validation part is written once as a subroutine so it can be reused in many programs.
Question 2
A // Ana wrote GetMarks
B // Raj wrote ShowReport
C GetMarks()
D CALL ShowReport()
Line C — A procedure written by a team member is run with the CALL keyword. It should be CALL GetMarks().
Question 3
A // Program 1: sign-up
B INPUT Age
C CALL CheckAge[Age]
D OUTPUT "Welcome"
Line C — Arguments are passed inside round brackets, not square brackets. It should be CALL CheckAge(Age), so the same validation procedure can be reused.
Question 4
A FUNCTION Ok(N) RETURNS BOOLEAN
B IF N >= 1 AND N <= 10 THEN
C RETURN TRUE
D ENDWHILE
E RETURN FALSE
F ENDFUNCTION
Line D — An IF statement must be closed with ENDIF, not ENDWHILE. The line should be ENDIF so this reusable validation function is complete.
Question 5
A FOR Count ← 1 UNTIL 3
B INPUT Age
C CALL CheckAge(Age)
D NEXT Count
Line A — A FOR loop uses TO to give the end value, not UNTIL. It should be FOR Count ← 1 TO 3. The reused CheckAge procedure is then called each time round the loop.

Student with a class code? Join your class →