← IGCSE Computer Science Paper 2

Explaining how subroutines make a program easier to maintain

A full maintenance answer names a benefit of subroutines, such as one place to change, then uses because to give the reason, ideally with an example from the program, not just 'it is easier'.

Understanding Explaining how subroutines make a program easier to maintain in IGCSE Computer Science Paper 2

What it does: The tax calculation is written once inside the function, so a change to the rate is made in one place only. Three calls use one ShowMenu definition, so editing that one procedure updates every place it is used. A full answer names a benefit and gives a reason. 'It is easier' just repeats the question and gives no reason. 'Because' shows the reason for the benefit, for example: one place to change because every call uses the same code. Copied code is not linked. Each copy must be changed separately, which is slow and error-prone. A call does not hold a copy. It sends control to the single subroutine, so one edit updates every call.

Common mistakes: A procedure call needs the CALL keyword. It should be CALL ShowBanner(). The banner text can then be changed in one place and every call shows the new text. A function header must state the data type it returns. It should be FUNCTION Tax() RETURNS REAL. Changing the rate in one place then updates every call.

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 439–448) and word search (Modules 439–458).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which answer about maintenance earns full marks?
Subroutines make maintenance easier because it is easier.Subroutines make maintenance easier because a change is made once in the subroutine and every call uses the new code.
Matches
Answer: Subroutines are better and easier to use.
↓
This is vague. It names no benefit and gives no reason. Fix it by naming a benefit and adding 'because' with a reason.
Applying
Meanings
Term
benefit because reason
Meaning
A full maintenance answer names a benefit of subroutines, such as one place to change, then uses because to give the reason, ideally with an example from the program, not just 'it is easier'.
Practice
Subroutines make a program easier to maintain
Testing
Gaps
the code is written only once
Check Answer
Spots
3ENDPROCEDURE
4ShowBanner()

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

The 'Nautilus' badge — Default Expert, 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. Which answer about maintenance earns full marks?
A. Subroutines make maintenance easier because a change is made once in the subroutine and every call uses the new code. ✓
B. Subroutines make maintenance easier because it is easier.
A full answer names a benefit and gives a reason. 'It is easier' just repeats the question and gives no reason.
2. Which word links a benefit to its reason in an exam answer?
A. and also
B. because ✓
'Because' shows the reason for the benefit, for example: one place to change because every call uses the same code.
3. A program prints a school header in 10 places. The header text must change. Which explanation is best?
A. With a PrintHeader procedure, you edit one place because all 10 calls run that same procedure. ✓
B. With a PrintHeader procedure, it is quicker and simpler to update.
The best answer uses the example (PrintHeader, 10 calls) and gives a reason. 'Quicker and simpler' is vague.
4. Which is a vague answer that would not earn full marks?
A. It means a bug fixed in the subroutine is fixed for every call because the code is only written once.
B. It makes the program easier to maintain. ✓
A vague answer gives no benefit and no reason. The other answer names a benefit (one fix) and a reason (code written once).
5. A program has the VAT calculation copied 8 times with no subroutine. The VAT rate changes. What is the maintenance problem?
A. All 8 copies must be found and edited, and missing one leaves a mistake. ✓
B. Only one line needs changing because the copies are linked.
Copied code is not linked. Each copy must be changed separately, which is slow and error-prone.

Match the Pairs

Subroutines make changes easier because the code is in one place. → A full answer: it names a benefit (easier changes) and uses 'because' to give a reason (one place to edit).
Subroutines make it easier. → A vague answer: it gives no benefit and no reason, so it earns no marks.
Use an example from the program: if the VAT rate changes, only the CalculateTotal function needs editing. → FUNCTION CalculateTotal(Price : REAL) RETURNS REAL RETURN Price * 1.2 ENDFUNCTION
With subroutines, a repeated task is written once and called many times, so a fix is made once. → CALL ShowMenu() CALL ShowMenu() CALL ShowMenu()
Answer: Subroutines are better and easier to use. → This is vague. It names no benefit and gives no reason. Fix it by naming a benefit and adding 'because' with a reason.
Answer: Subroutines are good for maintenance because they are good. → The reason just repeats the claim. It should name a specific benefit, such as one place to change, and explain it.

Key Term

benefit because reason
A full maintenance answer names a benefit of subroutines, such as one place to change, then uses because to give the reason, ideally with an example from the program, not just 'it is easier'.

Fill in the Blanks

1. Benefit: one place to change because the code is written only once
Hint: Type the linking word that joins a benefit to its reason.
2. PROCEDURE PrintHeader() OUTPUT "Quiz Game" ENDPROCEDURE
Hint: Type the keyword that closes the procedure. The heading is edited only inside this one subroutine.
3. CALL PrintHeader() CALL PrintHeader() OUTPUT "Next round"
Hint: Type the keyword that runs the procedure again, so the code is reused instead of copied.
4. FUNCTION AddVAT(p : REAL) RETURNS REAL RETURN p * 1.2 ENDFUNCTION
Hint: Type the keyword that sends the result back to the caller. The rate can be changed in this one place.
5. Easy to test because each subroutine can be checked on its own.
Hint: Type the word that links the benefit of easier testing to the reason.

Spot the Error

Question 1
A PROCEDURE ShowBanner()
B OUTPUT "Welcome to Shop"
C ENDPROCEDURE
D ShowBanner()
Line D — A procedure call needs the CALL keyword. It should be CALL ShowBanner(). The banner text can then be changed in one place and every call shows the new text.
Question 2
A // VAT rate: one place only
B FUNCTION Tax()
C RETURN 0.2
D ENDFUNCTION
E Cost ← 80 + 80 * Tax()
Line B — A function header must state the data type it returns. It should be FUNCTION Tax() RETURNS REAL. Changing the rate in one place then updates every call.
Question 3
A PROCEDURE Show(N : INTEGER)
B OUTPUT "Item ", N
C ENDFUNCTION
D CALL Show(5)
Line C — A procedure must finish with ENDPROCEDURE, not ENDFUNCTION. Matching start and end keywords keep the code easy to read and maintain.
Question 4
A // Test Area() once, reuse it
B SmallRoom ← Area(3, 4)
C BigRoom ← CALL Area(10, 8)
D OUTPUT SmallRoom, BigRoom
Line C — A function is called inside an expression and does not use CALL. It should be BigRoom ← Area(10, 8). Testing Area() once makes testing easier because all calls use the same code.
Question 5
A PROCEDURE Print Header()
B OUTPUT "Class 10A Report"
C ENDPROCEDURE
D CALL PrintHeader()
Line A — A subroutine name cannot contain a space. It should be PrintHeader in Pascal case. Clear names make a program easier to read and maintain.

Student with a class code? Join your class →