Key Idea: Computational thinking turns a problem into something a computer can be told to do: break it up, strip out what does not matter, notice what repeats, then write down the steps. None of it requires a computer.
Paper 1
- Name and define the four concepts.
Paper 2
- Trace an algorithm; identify inputs, processing and outputs.
Both
- Show the trace table — method marks survive a wrong final answer.
🧩 The four concepts
| Concept | What it does |
|---|---|
| Decomposition | Break the problem into parts solvable and testable separately |
| Abstraction | Remove detail that does not matter for this problem |
| Pattern recognition | Notice where parts resemble each other, so one solution serves several |
| Algorithm design | Set out the unambiguous steps for each remaining part |
A timetabling system needs a student's subjects and not their address; a mailing system needs the address and not the subjects. The same real thing is represented differently because the purpose differs.
📋 Specifying the problem
What a specification must pin down
- The inputs, the processing and the outputs — what is required, never how
- What happens with invalid input, or the program does whatever falls out of the code
- The edge cases: empty input, a single item, a value exactly on a boundary
- Success criteria that can be judged pass or fail — 'shows the total out of 20', not 'is easy to use'
Important: A running total starts at 0. A running product starts at 1. A highest-so-far starts at the first element — starting it at zero makes a list of negative numbers report a value it does not contain.
🔎 Tracing
How to trace so you never guess
- One column per variable, one row per step — and a column for the loop condition
- A WHILE loop tests BEFORE the body, so it may run zero times
- A REPEAT-UNTIL tests AFTER, so the body always runs at least once
- Nested loops multiply: an inner loop of 3 inside an outer of 4 runs 12 times
- Where the inner limit depends on the outer variable, the total is a sum, not a product
📝 Exam-style questions
Trace this algorithm and state the output. SET t TO 0 · SET n TO 5 · WHILE n > 0: IF n MOD 2 = 1 THEN SET t TO t + n · SET n TO n − 1 · END WHILE · OUTPUT t
🔒 Model answer plan
See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.
A program calculates the average mark for a class. Suggest three test cases you would use, stating what each one checks.
🔒 Model answer plan
See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.
✅ Quick check
Cover the answers.
Which loop can run zero times? WHILE — it tests before the body. REPEAT-UNTIL always runs at least once.
What does a running product start at? 1. Starting at 0 makes every product zero.
Why initialise 'highest so far' to the first element? Starting at 0 makes a list of negative numbers report 0 — a value not in the data.
Inner loop of 5 inside an outer loop of 3 — how many times does the body run? 15. Nested loops multiply.
Why are boundary values the best test cases? A mid-range value passes whether the condition used > or ≥, so it proves nothing. Only the boundary distinguishes them.
Exam tips
- Show the trace table — method marks survive a wrong final answer; a bare number earns none.
- Add a column for the loop condition; it shows WHY the loop stopped.
- Sums start at 0, products at 1, highest-so-far at the first element.
- WHILE tests before, REPEAT-UNTIL after. That decides whether the body can run zero times.
- Nested loops multiply — unless the inner limit depends on the outer variable, when they sum.
- Test normal, boundary and erroneous data, and state the expected result for each.