Amending an algorithm
Find the part that must change for the new requirement, change only that part, then re-trace the algorithm to check the rest still works.
Understanding Amending an algorithm in IGCSE Computer Science Paper 2
What it does: Adding a new input is a sub-theme of amending. Add the new INPUT (and prompt) without rewriting the rest. Adding a decision to an existing algorithm uses an IF ... ENDIF that holds the new action. The old code stays as it is. Amend only the part that must change. Here that is the limit in the condition. The rest of the algorithm can stay the same. The perimeter needs a new calculation and a new OUTPUT statement. The existing area calculation does not need to change. A small change can still break other parts. Re-tracing with test data shows whether the whole algorithm still gives the right outputs.
Common mistakes: The requirement changed the pass mark to 40, but the condition still uses the old limit 50. Only this limit should change: IF Mark >= 40. A third input was added, but the new value Mark3 is not included in the total. The line should be Total ← Mark1 + Mark2 + Mark3 so that dividing by 3 gives the correct mean.
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 254–264) and word search (Modules 254–274).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
amend an algorithmFill in the Blanks
Spot the Error
Student with a class code? Join your class →