This note shows how to document an algorithm using the three representation techniques required by the Cambridge International AS & A Level Computer Science (9618) syllabus:
It also demonstrates how to move between the representations, refine a high‑level description, handle edge cases, discuss efficiency, and link the activity to the relevant syllabus units and assessment objectives.
Task: Find the maximum value in a list of n positive integers.
| Identifier | Type | Purpose |
|---|---|---|
n | integer | Number of elements in the list |
value | integer | Current element being examined |
max | integer | Largest value found so far |
i | integer | Loop counter (controls iteration) |
n.n = 0 then output “No data” and stop.max.i ← 2.i ≤ n:value.value > max then set max ← value.i ← i + 1.max as the largest number.| Line | Action |
|---|---|
| 1 | READ n
Support e-Consult KenyaYour generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya. |