Lesson overview
Use ordered instructions, decisions and loops to control how a program runs.
Focus: Sequence, selection and iteration.
What you will learn
- Explain sequence as instructions running in order.
- Use selection for decisions based on conditions.
- Use iteration for repeated instructions.
- Choose between count-controlled and condition-controlled loops.
Before you start
- Simple algorithms.
- Comparison operators such as less than or equal to.
- Input, processing and output.
Control-flow examples
Use the password, score and countdown examples to choose sequence, selection or iteration.
Sequence, selection and iteration infographic

Explanation
Sequence means instructions run in order. The order matters because later instructions may depend on values created earlier.
Selection means a program chooses between paths using a condition. An if statement is a common form of selection.
Iteration means repeating instructions. A loop might repeat a known number of times, or it might continue until a condition changes.
Worked examples
Password attempts
attempts = 0
WHILE password is incorrect AND attempts < 3
ask for password and add 1 to attempts
Answer: This uses iteration controlled by a condition, with selection needed to decide whether access is allowed.
Quick checks
1. Which control structure is best for choosing between adult and child ticket prices?
- a. Iteration
- b. Selection
- c. A file extension
Reveal answer
Answer: b. Correct. A condition chooses the branch.
Not quite. Look for a decision.
2. Which control structure repeats instructions?
- a. Sequence only
- b. Output only
- c. Iteration
Reveal answer
Answer: c. Correct. Iteration means repetition.
Not quite. Think about loops.
Practice
1. Give one example of sequence in a breakfast-making algorithm.
Reveal answer
Answer: Put bread in toaster, start toaster, then remove toast.
Marking: Credit ordered steps where order matters.
2. Write a condition for checking whether score is at least 10.
Reveal answer
Answer: score >= 10.
Marking: Credit equivalent comparison language.
3. Choose a loop type for repeating exactly 5 times.
Reveal answer
Answer: A count-controlled loop.
Marking: Credit for loop or counted repeat.
4. Choose a loop type for repeating until a correct password is entered.
Reveal answer
Answer: A condition-controlled loop.
Marking: Credit while or repeat-until style loop.
Exam practice ladder
- Fluency: recall the key term and use it accurately.
- Application: apply the idea to the scenario rather than giving a generic definition.
- Algorithmic reasoning: show the steps, condition or variable change clearly.
- Evaluation: explain why one method, structure or control is suitable.
Answers and marking guidance
Exact answers and marking guidance are hidden under each question. For this lesson, earn marks by naming the correct Computer Science idea, applying it to the scenario and showing the logic or value change clearly.
Common mistakes
- Using a loop when one decision is enough.
- Writing a condition that can never become false.
- Putting instructions in an order that uses a variable before it exists.
- Forgetting to update the loop counter or condition value.
Extension
Design a menu algorithm that keeps asking until the user chooses a valid option.
Next lesson
Next, continue with Variables and Data Types.
Exam-board guidance
Aplailasain is an independent learning resource and is not endorsed by any exam board.
AQA GCSE Computer Science
AQA GCSE Computer Science: this skill supports problem solving, clear algorithms and accurate programming explanations.
OCR GCSE Computer Science
OCR GCSE Computer Science: expect precise algorithm reasoning, trace work and careful use of programming vocabulary.
Pearson Edexcel GCSE Computer Science
Pearson Edexcel GCSE Computer Science: practise explaining the method as well as giving the final answer or code.
Eduqas GCSE Computer Science
Eduqas GCSE Computer Science: secure the transferable idea first, then check how your class applies it in tasks.
WJEC Wales
WJEC Wales: use accurate terminology and show enough working for the examiner to follow your logic.
CCEA
CCEA: connect the idea to your class route and use the same algorithm, programming or systems vocabulary your teacher uses.