OCR H446 · Component 02 · Algorithms and programming
2.2.1 Programming techniques
Trace program constructs, parameters, recursion and object-oriented behaviour; use debugging tools deliberately.
What to revise
Practise programming techniques.
Start with these questions from the programming techniques topic pack. In the workspace, explain each idea from memory, compare your reasoning with the feedback, then revisit the concepts that need practice.
Use the pack alongside your OCR H446 algorithms and programming revision. Your self-reported confidence helps plan the next review; it is not an exam mark or predicted grade.
- 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
RecallStride is independently produced and is not endorsed by OCR. OCR is a registered trademark of OCR. Topic content is published by its owner and has not yet had an independent academic review.