🎯 Syllabus & Goals 3 min
Cambridge 7.2 · Design methods — flowcharts Cambridge 7.9 · Flowchart symbols Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Name and draw the six standard flowchart symbols and state what each is for.
- Follow a flowchart with given data and state its output.
- Draw a flowchart that uses a decision for both selection and a repeat loop.
Textbook: Chapter 7, §7.2.3 Flowcharts (pp. 262–264)
Recap / Warm-Up 5 min
Last lesson a structure diagram showed what the parts are. It did not show the order things happen. A flowchart does exactly that, for one sub-system at a time.
Quick starter
Write the steps to make a cup of tea as a numbered list. Which step involves a decision?
Reveal a model answer
1 Fill kettle · 2 Boil · 3 Tea bag in cup · 4 Pour water · 5 Milk wanted? If yes, add milk · 6 Serve. Step 5 is a decision: it has two possible paths.
🧠 Key Concept 14 min
1 · What a flowchart shows
A flowchart shows, as a diagram, the steps needed to complete a task and the order in which they happen. Those steps, in that order, are an algorithm. Flowcharts are a clear way to communicate how a system or sub-system works.
2 · The standard symbols
3 · Rules for drawing a good flowchart
- Exactly one START and at least one STOP.
- Every symbol is joined by arrowed flow lines — never a bare line.
- A decision is a question with two exits, labelled yes and no.
- A loop is drawn by a flow line going back up to an earlier symbol.
- Short variable names (N, D) are fine if the text would not fit in the box.
Worked Example 12 min
Worked example 1 · A smart kettle that switches itself off
A smart kettle heats water, checks the temperature every second, and switches off with a beep at 100 °C.
- Trace with sensor readings 97, 99, 100. Temp = 97 →
97 >= 100?no → wait → read again.the no-path is the loop, so it must lead back to the input. - Temp = 99 → no → wait → read again.
- Temp = 100 →
100 >= 100?yes → heater off → Beep → STOP.>=includes 100 itself. With>the kettle would keep boiling at 100 °C.
Worked example 2 · Swimming-pool group tickets
A pool charges $6 per swimmer. Groups of 5–7 get 10% off; groups of 8 or more get 25% off. A booking must be for 1 to 10 swimmers. Draw the flowchart, then write the same algorithm as pseudocode.
The same algorithm in Cambridge pseudocode
REPEAT
OUTPUT "How many?"
INPUT N
UNTIL N >= 1 AND N <= 10
IF N < 5
THEN
D ← 0
ELSE
IF N < 8
THEN
D ← 0.1
ELSE
D ← 0.25
ENDIF
ENDIF
Cost ← N * 6 * (1 - D)
OUTPUT "Cost: $", Costn = 0 while not (n >= 1 and n <= 10): n = int(input("How many? ")) if n < 5: d = 0 elif n < 8: d = 0.1 else: d = 0.25 cost = n * 6 * (1 - d) print("Cost: $", round(cost, 2))
How many? 12 How many? 8 Cost: $ 36.0
- Input 12.
12 <= 10is false, so the decision is no → back to the prompt.the loop rejects data outside 1–10 and asks again. - Input 8. Valid →
8 < 5?no →8 < 8?no → D ← 0.25. - Calculate. 8 × 6 = 48; 1 − 0.25 = 0.75; 48 × 0.75 = 36.brackets are worked first, so the discount is taken off the full price.
- Check other groups: 3 swimmers → $18; 5 → 30 × 0.9 = $27; 10 → 60 × 0.75 = $45.
Try It Yourself 12 min
Goal: Using the pool flowchart, state the output for inputs of (a) 4, (b) 7, (c) 0 then 1.
Goal: Draw a flowchart that inputs two numbers and outputs the larger one, with the message is largest. Label both exits of your decision.
Goal: Draw a flowchart for a door keypad. It inputs a 4-digit code. If the code is 2580 it outputs "Open" and stops. Otherwise it outputs "Wrong". After three wrong codes it outputs "Locked" and stops.
Hint
You need a counter set to 0 before the loop, a decision for the code, and a second decision Tries = 3? on the wrong-code path that either loops back or goes to "Locked".
📝 Exam Practice 10 min
Identify the flowchart symbol used for each of: (a) START; (b) INPUT Age; (c) Age > 17?; (d) Count ← Count + 1.
Mark scheme
- (a) Terminator — rounded rectangle / stadium shape (1).
- (b) Input/output — parallelogram (1).
- (c) Decision — diamond (1).
- (d) Process — rectangle (1).
Using the swimming-pool flowchart in the worked example, state the output when the inputs are: (a) 6; (b) 11 then 2; (c) 9.
Mark scheme
- (a) Cost: $ 32.4 (6 × 6 × 0.9) (1).
- (b) 11 is rejected / prompt shown again; then Cost: $ 12 (1).
- (c) Cost: $ 40.5 (9 × 6 × 0.75) (1).
Draw a flowchart for an algorithm that inputs a temperature. It outputs "Too hot" if the temperature is above 30, "Too cold" if it is below 10, and "OK" otherwise.
Mark scheme
- START and STOP terminators (1).
- Input of the temperature in a parallelogram (1).
- Decision
Temp > 30?with yes → output "Too hot" (1). - Second decision
Temp < 10?on the no path, yes → "Too cold", no → "OK" (1). - Outputs in parallelograms; all flow lines arrowed and decision exits labelled (1).
Explain how a decision symbol can be used to make a flowchart repeat some steps.
Mark scheme
- One exit of the decision has a flow line going back to an earlier step (1)…
- …so those steps run again until the condition leads to the other exit (1).
🗝️ Recap & Key Terms 3 min
A flowchart shows an algorithm's steps and their order using standard symbols. Decisions have two labelled exits and give both selection and repetition. Every flowchart has a START and a STOP.
- Flowchart
- A diagram showing the steps required for a task and the order in which they are performed.
- Algorithm
- An ordered set of steps to solve a problem.
- Terminator
- The symbol at the start and end of a flowchart.
- Decision
- A diamond holding a yes/no question, with two labelled exits; used for selection and repetition.
- Input/output symbol
- A parallelogram used for both entering data and showing information.
- Predefined process
- A process defined elsewhere (a sub-routine), shown by name only.
Homework 1 min
Task (≤ 15 min): A cinema charges $8 for an adult and $5 for a child (under 13). Draw a flowchart that inputs an age, rejects ages below 0 or above 120 (asking again), and outputs the correct price. [5]
Model answer
- START →
INPUT Age(parallelogram). - Decision
Age >= 0 AND Age <= 120?— no → flow line back to the input. - yes → decision
Age < 13?. - yes →
OUTPUT "$5"; no →OUTPUT "$8"(both parallelograms). - Both paths → STOP. Every decision exit labelled yes/no; every line arrowed.