KS3 · Computer Science

Flowcharts for algorithms

A flowchart adds 5 to a number while it’s under 20. Start it at 8. Does it output 20? Most people think so. Follow the arrows and find out.

Computer Science · Flowcharts

Saving up: follow the flow

An algorithm is a precise, ordered set of steps, and a flowchart draws one as shapes joined by arrows. This one takes in how much money you have saved, keeps adding 5 while the total is under 20, then outputs the total. The input is 8. Step through it and watch which shape lights up.

Before you press Next: with an input of 8, what number do you think this flowchart will output?

YesNoStartINPUT moneymoney < 20?money = money + 5OUTPUT moneyEnd

Output

 

Step 1: Every flowchart begins at its Start. From here, you just follow the arrow.

1 / 11

Use Next and Back to move one step at a time. Every value shown is worked out for you, step by step.

Step 1 of 11: Every flowchart begins at its Start. From here, you just follow the arrow..

Watch out: Check the value every time the flow arrives at the diamond. The loop can only end there, at the moment the answer to “money < 20?” is No.

The four symbols

Which shape does each step belong in?

Which flowchart symbol should hold each step?

Still to sort

Terminator (rounded rectangle or oval) (0)

Marks the start or the end of the algorithm.

Where the line is: A terminator holds Start or End only. Any instruction that does something goes in a different shape.

Process (rectangle) (0)

An instruction or a calculation.

Where the line is: If data is coming in or a result is going out, it is input/output, not a process.

Input/output (parallelogram) (0)

Data coming in, or results going out.

Where the line is: Asking the user to type something is input, even though it sounds like a question. A diamond is only for a yes/no question the algorithm decides.

Decision (diamond) (0)

A question with two exits, such as yes/no or true/false.

Where the line is: It must be a question with exactly two answers, one for each exit. If nothing is being asked, it is not a decision.

9 of 9 still to sort.

A flowchart uses four standard shapes. Pick a step, then pick the shape it must go in.

Loops

What actually stops a loop?

A flowchart has an arrow pointing back up to an earlier step, so some of its steps repeat.

Which is closest to what you think makes the repeating stop?
How sure are you?

Your turn to draw

From words to a flowchart

Turn this algorithm into a flowchart: “Keep asking the user for the password until they type the correct one. Then display Welcome.” Choose each missing step.

  1. Draw a Start terminator at the top.Every flowchart has exactly one Start.
  2. missing step
Which line is step 2?

Find the mistake

Where did the trace go wrong?

A cinema flowchart works out a ticket price: Start → INPUT age → decision “age < 12?”. Yes: price = 5. No: price = 8. Both paths then go to OUTPUT price → End. Sam traces it with an input of 14. Find the line where Sam’s trace goes wrong.

Sam’s trace — which line goes wrong?

Which flowchart is better?

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.vsFlowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

Both flowcharts are meant to output the larger of two numbers, A and B. If the numbers are equal, outputting either one is fine.

Focus

Test: A = 6, B = 6

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.

A > B? No. OUTPUT B, so it outputs 6. Correct.

Flowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

A > B? No. B > A? No. End. It outputs nothing. Wrong.

The insight

Equal numbers break Flowchart 2. Neither question gets a Yes, so the flow reaches End without outputting anything.

Test: A = 9, B = 2

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.

A > B? Yes. Outputs 9.

Flowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

A > B? Yes. Outputs 9.

Test: A = 3, B = 7

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.

1 decision, then OUTPUT B. Outputs 7.

Flowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

2 decisions, then OUTPUT B. Outputs 7.

Works for every input?

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.

Yes

Flowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

No: it fails whenever A and B are equal

Verdict

Flowchart 1: one decision. “A > B?” Yes: OUTPUT A. No: OUTPUT B.

Better: always correct, and fewer steps

Flowchart 2: two decisions. “A > B?” Yes: OUTPUT A. No: “B > A?” Yes: OUTPUT B. No: End.

Worse: more steps, and wrong for some inputs

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

A flowchart is an algorithm you can follow with your finger. The arrows set the order, a diamond picks the path, and an arrow pointing back makes steps repeat until a question says stop.

What you need to know

  • An algorithm is a precise, ordered set of steps (instructions) for solving a problem or completing a task. You can represent it before it is programmed, for example as a flowchart or as written steps.
  • A flowchart is a diagram of an algorithm made from standard shapes joined by arrows (flow lines). The arrows show the order the steps are carried out in.
  • The four symbols: a terminator (rounded rectangle or oval) marks Start and End; a process (rectangle) holds an instruction or calculation; an input/output (parallelogram) shows data coming in or results going out; a decision (diamond) holds a question with two exits, such as yes/no or true/false.
  • Sequence: steps follow one after another along the arrows, each carried out once, in order.
  • Selection: a decision asks a question whose answer is yes or no (true or false), and the algorithm follows a different path depending on the answer.
  • Iteration (repetition): an arrow leads back to an earlier step so a group of steps repeats. A decision controls when the repetition stops.
  • To draw a flowchart from a description: one Start and at least one End terminator, each step in the correct symbol, both exits of every decision labelled, and arrows showing the flow between every step.
  • To trace a flowchart, follow it step by step from Start to End with given inputs to work out the output. Tracing also checks whether the algorithm does what it should, so you can find and correct errors.
  • You can compare two flowcharts that solve the same problem by whether they work correctly for every input and by how many steps they take.

The big picture

A flowchart draws an algorithm (a precise, ordered set of steps) as standard shapes joined by arrows, and the arrows set the order. Terminators mark Start and End, rectangles hold processes, parallelograms hold input and output, and diamonds hold decisions with two exits. Steps can run in sequence, branch at a decision (selection), or repeat when an arrow leads back (iteration), with a decision controlling when the repeating stops. Trace a flowchart with real inputs to find its output and catch errors; compare two flowcharts by whether they work for every input and how many steps they take.

Key points

1Algorithm: a precise, ordered set of steps. Flowchart: that algorithm drawn as shapes joined by arrows.
2The arrows set the order, not the position of the boxes on the page.
3Oval or rounded rectangle = Start/End. Rectangle = process. Parallelogram = input/output. Diamond = decision.
4Every decision has two labelled exits, and the answer picks which one the flow takes.
5A loop is an arrow back to an earlier step. A decision decides when it stops.
6Trace with real inputs to find the output and to catch errors.
7The better flowchart works for every input first; then compare the number of steps.

Worked example

Problem

Trace this flowchart with an input of 4 and write down everything it outputs. Start → INPUT n → count = 1 → decision “count ≤ 3?”. Yes: OUTPUT n × count, then count = count + 1, then an arrow back up to the decision. No: End.

⚠ Watch out

Drawing a decision with only one way out, or a loop with no decision in it. Every decision needs two labelled exits, and every loop needs a decision that can send the flow out. Without one, the steps repeat for ever.

🧠

Memory hook

Ovals open and close, rectangles do, parallelograms pass data in and out, and diamonds decide. A loop only ends when a diamond lets it out.

✓

Check yourself

Cover the page. Sketch the four symbols and say what each holds. What makes a loop stop? What do you do at each diamond when tracing? How would you pick the better of two flowcharts?

Flashcards

(14)
What is an algorithm?
A precise, ordered set of steps (instructions) for solving a problem or completing a task.
What is a flowchart?
A diagram that represents an algorithm using standard shapes joined by arrows (flow lines).
In a flowchart, what do the arrows show?
The order in which the steps are carried out.
Which symbol marks the start and the end, and what shape is it?
A terminator: a rounded rectangle or an oval.
What goes in a rectangle (process box)?
An instruction or a calculation, such as total = total + 2.
What does a parallelogram show?
Input or output: data coming in, or results going out.
What does a diamond hold?
A decision: a question with two exits, such as yes/no or true/false.
What is sequence in a flowchart?
Steps that follow one after another along the arrows, each carried out once, in order.
What is selection in a flowchart?
A decision asks a yes/no question, and the algorithm follows a different path depending on the answer.
How does iteration (repetition) appear in a flowchart?
An arrow leads back to an earlier step, so a group of steps repeats.
What controls when a flowchart loop stops?
A decision. One of its answers sends the flow out of the loop.
Five checks for a flowchart you have drawn?
One Start; at least one End; each step in its correct symbol; both exits of every decision labelled; arrows between every step.
What does it mean to trace a flowchart?
Follow it step by step from Start to End with given inputs to work out its output, and check it does what it should.
Two ways to compare flowcharts that solve the same problem?
Whether each works correctly for every input, and how many steps each takes.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More KS3 Computer Science topics

See the full KS3 Computer Science curriculum →

How this lesson was checked. This KS3 Computer Sciencelesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 2 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.