Writing an algorithm for a described problem
To solve a described problem, list the inputs, pick the standard method, then write it: DECLARE variables, set start values, loop through the data, and OUTPUT the result.
Understanding Writing an algorithm for a described problem in IGCSE Computer Science Paper 2
What it does: The average is the total divided by the count, calculated after the loop, and then displayed with OUTPUT. Counting only items that meet a condition uses an IF inside the loop to increase the counter by 1. A running total must start at 0 so that only the marks are added. Starting at 30 (the number of marks) would make the answer wrong. Highest means maximum. A sort would reorder the whole list, but the problem only asks for one value. Meaningful identifier names such as PassCount make an algorithm easier to read and mark. A single letter tells you nothing.
Common mistakes: This line replaces Total with each mark instead of adding to it, so the loop ends with only the last mark. It should be Total ← Total + Mark[i]. The class has 5 marks, but the loop stops at 4, so the fifth mark is never added to the total. It should be FOR i ← 1 TO 5.
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 307–316) and word search (Modules 296–316).
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
DECLARE, loop, OUTPUTFill in the Blanks
Spot the Error
Student with a class code? Join your class →