Spec & Goals 3 min
AQA Spec 3.1.1 · Representing algorithms
By the end of this lesson you can:
- Explain what an algorithm is, and use decomposition and abstraction to plan one.
- Read and write a simple algorithm in AQA pseudo-code.
- Represent the same algorithm as a flowchart, using the correct symbols.
Warm-Up 5 min
This is your first algorithms lesson. Good news: you already follow algorithms every day — a recipe is one.
Quick starter
Aisyah wrote the steps for making teh tarik, but they are jumbled. Put them in a sensible order:
- Pour the tea between two cups to make it frothy.
- Add the condensed milk.
- Brew the tea leaves in hot water.
- Serve.
Reveal a sensible order
Brew the tea → add the condensed milk → pour between two cups → serve. The order matters — change it and the result is wrong. That is exactly what an algorithm cares about.
Key Concept — what an algorithm is 14 min
An algorithm is a precise sequence of steps that solves a problem or completes a task. The steps must be clear, in order, and finite — they come to an end.
Two thinking tools: decomposition and abstraction
Before writing an algorithm, we make the problem easier in two ways:
To build a quiz game you decompose it into "ask a question", "check the answer", and "keep the score". A map app uses abstraction — it hides the houses and trees and shows only the roads you need.
Two ways to represent an algorithm
- Pseudo-code — structured, code-like English. AQA has its own pseudo-code that the exam uses.
- Flowcharts — a diagram of boxes and arrows.
AQA pseudo-code — the basics
A few rules you will use all course:
| Pseudo-code | What it means |
|---|---|
x ← 5 | Assign (store) the value 5 in x. The ← is the assignment arrow. |
OUTPUT x | Display the value of x. |
x ← USERINPUT | Read a value typed by the user into x. |
IF … THEN … ELSE … ENDIF | Make a decision (this is selection). |
Flowchart symbols
Each shape has a fixed meaning — using the right one earns the mark.
Worked Example — the larger of two numbers 12 min
Problem: input two numbers and output the larger one.
Decompose: (1) get two numbers, (2) compare them, (3) output the bigger. Abstract: it does not matter what the numbers represent — only which is larger.
AQA pseudo-code
num1 ← USERINPUT
num2 ← USERINPUT
IF num1 > num2 THEN
OUTPUT num1
ELSE
OUTPUT num2
ENDIFThe same algorithm drawn as a flowchart:
The same algorithm in Python
num1 = int(input("Enter a number: ")) num2 = int(input("Enter a number: ")) if num1 > num2: print(num1) else: print(num2)
Try It Yourself 12 min
Goal: Write AQA pseudo-code that inputs two numbers and outputs their total.
Hint: read two values with USERINPUT, add them with +, then OUTPUT the result.
Goal: Write pseudo-code that inputs an age and outputs 'Adult' if it is 18 or over, otherwise 'Minor'.
Hint: you need an IF … THEN … ELSE … ENDIF with the test age ≥ 18.
Goal: Draw a flowchart for a program that inputs an exam mark and outputs 'Pass' if the mark is 50 or more, or 'Fail' otherwise. Use the correct symbol for each step.
📝 Exam Practice 10 min
Answer the way the examiner expects — the command word and the marks tell you how much to write.
Define the term decomposition.
Mark scheme
- Breaking a (larger) problem down into smaller sub-problems / tasks (1).
Describe the difference between an algorithm and a program.
Mark scheme
- An algorithm is a sequence of steps / a plan to solve a problem (1).
- A program is that algorithm implemented / written in a programming language (1).
State the name of the flowchart symbol used to represent a decision.
Mark scheme
- Decision box / diamond / rhombus (1).
Look again at the worked-example pseudo-code. State the output when the user enters num1 = 6 and num2 = 9.
Mark scheme
9(1) — because6 > 9is false, so theELSEbranch runs.
Recap & Key Terms 3 min
An algorithm is an ordered set of steps to solve a problem. We plan it with decomposition and abstraction, then represent it as pseudo-code or a flowchart. A program is the algorithm written in a real language.
- Algorithm
- A sequence of steps, in order, that solves a problem or carries out a task.
- Decomposition
- Breaking a problem into smaller, easier sub-problems.
- Abstraction
- Removing unnecessary detail to focus only on what matters.
- Pseudo-code
- A structured, code-like way of writing an algorithm (AQA has its own version for the exam).
- Flowchart
- A diagram of an algorithm using terminal, process, input/output and decision symbols joined by arrows.
- Selection
- Choosing between paths with a decision — written as
IF … THEN … ELSE … ENDIF.
Homework 1 min
Task (≤ 15 min): Write, in AQA pseudo-code, an algorithm that inputs two numbers and outputs their average.
Model answer
num1 ← USERINPUT num2 ← USERINPUT average ← (num1 + num2) / 2 OUTPUT average
Award marks for: two inputs (1), a correct mean calculation with brackets (1), output the result (1).