Not sure which lesson to do first? Find your level and get a plan →

CS Thinking · Software Design & Development · Grade 6-8

Flowchart

A visual diagram that represents the steps of an algorithm using standard shapes: ovals for start and end, rectangles for processes or actions, diamonds for decisions (yes/no questions), parallelograms for input/output, and arrows to show the flow of execution between steps.


Quick Answer

A visual diagram that represents the steps of an algorithm using standard shapes: ovals for start and end, rectangles for processes or actions, diamonds for decisions (yes/no questions), parallelograms for input/output, and arrows to show the flow of execution between steps. Draw one when the logic has branches or loops that are easier to follow as paths than as lines of text, such as a login check or a game turn. Following the arrows with a test value shows which boxes run, and a missing arrow stands out at a glance.

Why This Matters

A flowchart turns hidden control flow into something you can point at. A loop that never ends shows up as an arrow circling back with no way out; a decision that forgets the 'No' case shows up as a diamond with one arrow. That makes flowcharts good for catching logic errors before coding and for explaining a process to people who do not program, such as a shop owner describing how refunds work.

Intuitive Explanation

Picture the steps of a vending machine. Insert coins. Enough money? If no, insert more; if yes, choose a snack. Out of stock? If yes, choose again; if no, collect the snack. Draw each action as a rectangle, each question as a diamond, the coin slot and the snack tray as parallelograms (input and output), and the start and finish as ovals. Join them with arrows and you have a flowchart. Put your finger on Start and follow the arrows: the path your finger takes is exactly what the machine does.

The shapes are a code everyone agrees on, so a reader knows what kind of step each box is before reading it. A diamond always asks a yes/no question and always has at least two labelled exits. An arrow that points back up to an earlier box makes a loop: 'Enough money? No' sends you back to 'Insert coins' until the answer changes.

Not every boxes-and-arrows picture is a flowchart. A diagram of a website with Home linking to About and Shop is a site map: its arrows mean 'links to', not 'happens next', and a visitor can wander in any order. A flowchart's arrows always mean the order of execution. Pseudocode holds the same logic as text; flowcharts are clearer for branching, and pseudocode is quicker once the steps get long.

Think of it like this. A flowchart is a board game track: you start on one square, follow the arrows, and some squares ask a question that sends you down one of two paths. Like a good game board, every path must lead to the finish or back into play. Unlike a game, nothing is left to chance: the same input always takes the same path.

Core idea. Flowcharts make control flow visible. They're especially useful for understanding loops and branching logic.


When to Use

Draw a flowchart when the logic has decisions with different outcomes, loops that repeat until a condition changes, or when you need to explain a process to someone who will not read code. Questions that show the shapes and ask what is printed, or which path runs, want you to trace one. When the steps are long and mostly in a straight line, pseudocode is quicker to write and edit; when the question is what the system must do rather than how, use a design specification.

Tip. Ask: Are the steps drawn as shapes joined by arrows, with diamonds where the path splits on a yes/no answer?

How to Recognize It

Look at the diagram's shapes and arrows, and check whether it shows the order in which steps run or something else.

  1. Does the diagram show the order steps happen in, with arrows leading from one step to the next?

    Yes means a flowchart. A tree showing how a big task splits into smaller parts, with no running order, is a Decomposition diagram.

  2. Is there a diamond with two labeled exits, such as Yes and No?

    Yes means a decision point: follow the exit that matches your value. An arrow that points back up to an earlier box repeats those steps as a loop.

  3. Must you work out the output for a given input by following the arrows?

    Yes means trace it like a path, writing down the value at each box. The same task given as lines of IF and WHILE text is Pseudocode.

  4. Does the diagram show screens and buttons a user will see, rather than steps?

    Yes means it is a User Interface sketch, often called a wireframe. A flowchart shows logic, not layout.

Flowchart vs Pseudocode vs Algorithm vs Decomposition

Flowcharts, pseudocode and decomposition trees are all ways to plan on paper. Ask whether the plan is drawn or written, and whether a line between two boxes means 'do this next' or 'is made of'.

Flowchart

Meaning
A flowchart draws the steps of an algorithm as standard shapes, with arrows showing the order they run in.
Key test
Arrows mean 'next', and diamonds split the path on yes or no.
Example
Oval Start, box 'total = 0', diamond 'More items?' looping back, oval End.

Pseudocode

Meaning
Pseudocode writes the same steps as lines of structured plain text, with indents instead of arrows.
Key test
Written lines; loops and branches are shown by IF, WHILE and indenting.
Example
IF n > 0 THEN OUTPUT 'positive' ELSE OUTPUT 'not positive'.

Algorithm

Meaning
An algorithm is the method itself, which a flowchart, pseudocode or real code can each express.
Key test
The idea of the steps, before choosing how to show them.
Example
'Halve the search range each time' is one algorithm, whether it is drawn or written.

Decomposition

Meaning
Decomposition breaks a big problem into smaller parts, often drawn as a tree that shows what the parts are.
Key test
Lines mean 'is made of'; there is no running order or decision.
Example
'Plan a party' splits into guests, food and music, and each of those splits further.

Formula & Notation

Worked Examples

Example 1 — Trace a loop in a flowchart

Easy

A flowchart reads: Start → Input n → Set total to 0 → diamond 'Is n > 0?' → Yes: 'Set total to total + n', then 'Set n to n - 1', then back to the diamond; No: Output total → End. What does it output when n = 4?
Show the steps and the answer
  1. Begin with n = 4 and total = 0, then go to the diamond.

    The rectangle before the diamond runs once, so total starts at 0 before the loop begins.

  2. Go round the loop while the diamond says Yes: total becomes 4 (n = 3), 7 (n = 2), 9 (n = 1), 10 (n = 0).

    Each Yes adds the current n, lowers n by 1, and the arrow returns to the same question.

  3. Ask the diamond again with n = 0: 0 > 0 is No, so follow the No arrow to Output total.

    The loop exits only when the condition fails; this last check is where an off-by-one mistake would show.

  4. Output 10, then End.

    The chart has added 4 + 3 + 2 + 1, so it sums the whole numbers from n down to 1.

Answer: It outputs 10.

Takeaway: Trace a flowchart with a small table of variable values, one arrow at a time; any arrow that returns to an earlier diamond is a loop.

Example 2 — A site map is not a flowchart

Standard

A student draws a diagram for a school club website: a box 'Home' with arrows to 'Events', 'Members' and 'Join', and an arrow from 'Join' back to 'Home'. She labels it 'flowchart of the website'. Is it a flowchart? If not, draw the flowchart for what the Join page does when someone submits an email address.
Show the steps and the answer
  1. Ask what the arrows mean: 'Home links to Events'.

    In a flowchart an arrow means 'this step runs next'. Here a visitor can go in any order or stop anywhere, and nothing is computed, so it is a site map.

  2. Find a real process on the site: the Join page takes an email, checks it, and responds.

    A flowchart needs one start and a sequence of actions and decisions, which the submit process has.

  3. Draw it: Start → parallelogram 'Input email' → diamond 'Has an @ and a dot after it?' → No: parallelogram 'Show: please enter a valid email', back to 'Input email'; Yes: rectangle 'Add email to member list' → parallelogram 'Show: welcome' → End.

    The input and the messages are parallelograms because they cross between the user and the program; the check is a diamond with two labelled exits.

Answer: It is a site map, because its arrows mean 'links to', not 'happens next'. The Join flowchart: Start → Input email → Valid? No: show error and return to input; Yes: add to list → show welcome → End.

Takeaway: Flowchart arrows mean order of execution. Boxes that a person can visit in any order describe structure, not logic.

Example 3 — Find the mistake: a diamond with one exit

Application

Mia draws a flowchart for a heater: Start → Input temperature t → diamond 'Is t < 18?' → Yes: rectangle 'Turn heater on' → End. No other arrow leaves the diamond. Find the mistake and correct it, then say what the corrected chart does when t = 21.
Show the steps and the answer
  1. Count the exits from the diamond: one, labelled Yes.

    A decision must send every possible answer somewhere. With t = 21 the answer is No, and the flow has nowhere to go.

  2. Add the No exit: 'Is t < 18?' No → rectangle 'Turn heater off' → End.

    The heater must switch off when the room is warm enough, or it stays on once it has started.

  3. Trace t = 21: 21 < 18 is false, so follow No and turn the heater off.

    Running a value through the branch that was missing shows the new arrow is needed and leads to the right action.

Answer: The diamond needs a No exit. Corrected: Is t < 18? Yes → turn heater on → End; No → turn heater off → End. For t = 21 the heater is turned off.

Takeaway: Every diamond needs a labelled exit for each answer, and every path must reach End or loop back.

Where You'll See It

  • A 'choose your own adventure' map

    Each decision branches the story; a flowchart shows the same thing — diamonds are the yes/no choices and arrows trace which path you take to each ending.

  • A fire-drill poster

    The 'what to do in an emergency' chart on the wall is a flowchart: start, a few decision diamonds (Is the exit blocked?), and arrows to the safe meeting point.

  • Troubleshooting why a device won't turn on

    'Is it plugged in? If no, plug it in. If yes, is the switch on?' is a flowchart of decision diamonds and process boxes that makes the logic easy to follow.

Common Mistakes

  1. The slip: Any box shape works; the shapes are just decoration.

    Why it's tempting: They all hold text, so the specific shape seems cosmetic.

    Instead: Shapes carry meaning: ovals = start/end, rectangles = process, diamonds = decision, parallelograms = input/output. Using the wrong shape misleads the reader.

  2. The slip: A flowchart can have a box with arrows in but none out.

    Why it's tempting: The step does its job and the chart looks finished, so a dead end seems acceptable.

    Instead: Every non-end box needs an outgoing arrow so the flow always continues; only the end oval has no exit. A dead end means the logic has nowhere to go.

  3. The slip: A decision diamond can have just one arrow coming out.

    Why it's tempting: You drew the question, so the chart looks like it asked it.

    Instead: A decision diamond branches: it needs at least two labeled exits (e.g. Yes and No) so each answer leads somewhere.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Match each step to its flowchart shape: 'Start', 'Is the number even?', 'Add 1 to count', 'Print the total'.

    Hint: Ovals, diamonds, rectangles and parallelograms each have one job.

  2. A flowchart: Start, then input n. A diamond asks 'n > 10?'. Yes leads to 'Print n' and End; No leads to 'Set n to n × 2' and back to the diamond. What prints for n = 3, and how many times is the diamond checked?

    Hint: Follow the arrows, writing down n each time you reach the diamond.

  3. A flowchart sets i = 1, then a diamond asks 'i ≤ 3?'. Yes leads to 'Print i', then 'i = i + 1', and back to the diamond. No leads to End. What prints, and how many times is the diamond visited?

    Hint: Count the final visit, when the answer becomes No.

  4. In a flowchart, the No arrow from 'Is the door locked?' is missing, so No leads nowhere. What happens when the answer is No, and how do you fix it?

    Hint: Every path must reach End.

  5. A team needs a plan they will translate line by line into Python, and their editing tool cannot draw diagrams. Flowchart or pseudocode?

    Hint: Which format maps straight onto lines of code and is easy to type?

  6. A student puts 'Is the password correct?' inside a rectangle with one arrow coming out. What should change?

    Hint: Which shape is for questions, and how many exits does a question need?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

How do I draw a loop in a flowchart?

Use a decision diamond and an arrow that points back up. After the steps to be repeated, a diamond asks the stopping question, such as 'Is count < 10?', and the Yes exit returns to the first repeated box while No leads on. The basic set has no special loop shape; a loop is simply a path that comes back to where it was. Tracing the chart with a small number shows whether it really stops.

Why are input and output drawn as slanted boxes?

The parallelogram marks the moments when data crosses the edge of the program: a value typed by the user, a reading from a sensor, a result shown on screen. Keeping those apart from rectangles, which are calculations inside the program, makes it easy to see what the program needs and what it produces. Many charts also use a rectangle with extra side bars for a subroutine that has its own chart.

When is a flowchart better than pseudocode?

A flowchart wins when the logic branches a lot, because you can see every path at once, and someone who does not code can still follow it. Pseudocode wins as the program grows: a chart of 50 steps sprawls over pages, while 50 lines of text fit on one, and text is quicker to edit and closer to real code. Many people sketch a flowchart for one tricky decision and write pseudocode for the rest.

Learning Path

Flowchart

You are here

You need Algorithm (ordered steps that solve a problem) and Pseudocode (writing those steps with IF, WHILE and FOR). A flowchart adds a visual form: standard shapes for actions, decisions and input/output, and arrows for the order they run in, which makes branches and loops easy to trace. Next, Design Specification steps back to describe what a whole system must do, before its algorithms are drawn.

See Also