What to revise: OCR J277/02
- 2.1 Algorithms: decomposition, abstraction, searching, sorting and representation.
- 2.2 Programming fundamentals: variables, selection, loops, arrays/lists and subroutines.
- 2.3 Producing robust programs: validation, testing, defensive design and refinement.
- 2.4 Boolean logic: operators, logic gates and truth tables.
- 2.5 Programming languages and IDEs: translators, language features and development tools.
Follow the ordered OCR topics for specification detail.
Worked algorithm trace
total = 0
for n in [3, 1, 4]:
if n > 2:
total += n
print(total)The condition is true for 3 and 4 only. The running total changes 0 → 3 → 7, so the printed result is 7.
Try without notes: Explain why the program prints 7, not 8. 2 marks
Check an example answer and feedback
The loop does not add 1 because the condition n > 2 is false for that element. The two values added are 3 and 4.
Practical revision routine
- Trace a small program by hand before running it.
- Write a similar algorithm with changed data or a boundary case.
- Explain one reason why you chose a loop or function.
- Use normal, boundary and invalid test data to demonstrate robustness.
- Try a past-paper-style written explanation and self-mark it.
Use GCSE Python, code tracing and algorithms revision.
Official specification
OCR J277 specification at a glance. Assessment is 80 marks, 1 hour 30 minutes, worth 50% of the GCSE.
