OCR H446 ยท Component 02
2.2.1 Programming techniques
Trace program constructs, parameters, recursion and object-oriented behaviour; use debugging tools deliberately.
Topic overview
Build accurate recall, then apply it.
RecallStride combines active flashcards, quick checks, exam practice and scheduled review. Progress is based on learning evidence rather than passive completion.
- x = 7. Procedure change(p) performs p = p + 4, then p = p * 2. State x after change(x) under scalar pass-by-value and under pass-by-reference.Trace
- total = 0; read n; WHILE n != -1: total = total + n; read n. Inputs are 6,0,5,-1. State total and explain why -1 is not added.Trace
- Sketch a Counter class with private value, a constructor taking start, and an increment method. State the value after constructing with 4 and calling increment twice.Write
- What are sequence, selection and iteration?Constructs
- How do a pre-condition WHILE loop and a post-condition loop differ?Compare
- total = 0; for i = 1 to 3 inclusive: total = total + 2*i. What is total afterwards?Trace
Published with owner authorisation; awaiting independent academic review. RecallStride is independently produced and is not endorsed by OCR. OCR is a registered trademark of OCR.