The purpose of an algorithm
What the whole algorithm achieves, stated in one sentence, such as 'finds the largest of ten numbers'. It is not a line-by-line description. Check the OUTPUT and identifier names for clues.
Understanding The purpose of an algorithm in IGCSE Computer Science Paper 2
What it does: The OUTPUT of PassCount tells you the algorithm counts passes, so you begin your purpose statement from what is output. The names TotalCost and Price suggest the algorithm adds up prices to find a total cost, which helps you state the purpose. A purpose is a one-sentence summary of the overall result. Line-by-line detail earns no marks for the purpose. Meaningful identifier names are clues. Highest and Score suggest finding the highest score. The output symbol and the wording in the symbols reveal what the flowchart achieves. Counting lines does not. A better purpose is 'finds the smallest of the numbers entered', based on the OUTPUT and names like Min.
Common mistakes: The purpose is to find the total of ten numbers. The OUTPUT is Total, so each Num must be added to Total. It should be Total ← Total + Num. Without this, Total just holds the last number. The purpose is to count passes, so the counter Passes must start at 0. Starting at 10 makes the OUTPUT wrong. It should be Passes ← 0.
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 216–231) and word search (Modules 188–231).
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
purposeFill in the Blanks
Spot the Error
Student with a class code? Join your class →