Signed up recently but had issues with the confirmation email?

Click Forgot password and follow the reset steps. You can choose the same password you used when you signed up. This should then provide access.

Remember to check Spam and Junk. The email will be from auth@progressbytes.co.uk.

Revision notesQuestionsFor schools
Revise Computing
Log inStart revising free
Revision notesQuestionsFor schoolsLog in

© 2026 Revise Computing · revisecomputing.co.uk

Worried about something?Question Bank UpdatesPrivacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).

Knowledge/A Level/H446/02 Algorithms and programming/Programming Techniques/Programming constructs

Programming constructs: sequence, iteration, branching

Programming constructs: sequence, iteration, branching.

2.2.1 Programming Techniques

Practise exam questions

Programming Techniques — Note 1 of 6

Candidates need to understand the constructs of sequence, iteration and branching, and use them independently and in combination to produce a solution. This includes IF (with ELSEIF and ELSE) and select case statements, and both condition-controlled (e.g. while, repeat until) and count-controlled (e.g. FOR) iteration. Candidates need to be able to read, create and trace code (for example using a trace table) that uses these constructs.

What you need to know

All programs are built from three constructs: sequence, iteration and branching (selection). You need to use them independently and in combination, and read, create and trace code that uses them.

What to know

  • A while loop checks its condition BEFORE each iteration (it may run zero times); a do ... until loop checks AFTER (it always runs at least once).
  • A condition-controlled loop can be used as a count-controlled loop by updating a counter inside it. Trace its first and last pass to check it gives exactly the same outputs (see 1.2.4b for setting up the counter).
  • Constructs can be nested, e.g. a selection statement inside a loop.

Code examples

Sequence, selection and iteration in OCR pseudocode
text
total = 0
for i = 1 to 5
    mark = int(input("Enter mark: "))
    if mark >= 0 AND mark <= 100 then
        total = total + mark
    else
        print("Invalid mark")
    endif
next i

do
    answer = input("Continue? (y/n) ")
until answer == "y" OR answer == "n"

switch answer:
    case "y":
        print("Continuing")
    default:
        print("Goodbye")
endswitch

Key terms

Sequence

Instructions executed one after another in order.

Branchingselection

Choosing which code to run based on a condition, using if ... then ... elseif ... else ... endif or switch/case. The chosen branch runs once; code that repeats is iteration, not branching.

Iteration

Repeating code. Count-controlled loops (for) repeat a set number of times; condition-controlled loops (while, do ... until) repeat until a condition changes.

Exam technique

  • Tip:Use a trace table to follow code that combines these constructs.
  • Mistake:Initialising a counter or total inside a loop, so it is reset every iteration. A return that always runs inside a loop ends the function on the first pass: put it after the loop, or inside an if to stop early, e.g. once an item is found.

Past exam questions

  • June 2026Paper 1Q1(a)5marks
  • June 2026Paper 1Q1(b)(i)6marks
  • June 2025Paper 2Q1(c)(ii)1mark
  • June 2024Paper 2Q1(b)2marks
  • June 2024Paper 2Q1(c)4marks
  • June 2023Paper 1Q2(a)5marks
  • June 2023Paper 2Q4(a)(ii)1mark
  • June 2023Paper 2Q4(a)(iii)1mark
  • June 2022Paper 1Q5(e)(i)3marks
  • June 2022Paper 2Q1(b)(iii)4marks
  • November 2021Paper 2Q2(a)(ii)1mark
  • November 2021Paper 2Q8(b)(i)5marks
  • November 2021Paper 2Q8(b)(iii)3marks
  • November 2021Paper 2Q8(b)(iv)6marks
  • June 2019Paper 2Q3(a)(i)1mark
  • June 2019Paper 2Q3(a)(ii)2marks
  • June 2018Paper 2Q5(d)(iii)4marks

Ready to test yourself?

Practise 2.2.1 questions
← Previous topicOutline the benefits and trade offs of concurrent processing in a particular situation2.1.5 Thinking ConcurrentlyNext note →Recursion, how it can be used and how it compares to an iterative approach2.2.1 Programming Techniques

Back to Programming Techniques

Programming Techniques

Note 1 of 6

  1. 1Programming constructs: sequence, iteration, branching
  2. 2Recursion, how it can be used and how it compares to an iterative approach
  3. 3Global and local variables
  4. 4Modularity, functions and procedures, parameter passing by value and by reference
  5. 5Use of an IDE to develop/debug a program
  6. 6Use of object oriented techniques
Topic overview