Algorithms & Flowcharts — Worked Examples
A hands-on workshop of fully worked algorithm examples. For every problem you get a flowchart, pseudocode, a step-by-step trace table, and the Python code — so you can see exactly how an idea becomes a working program. This is the heart of building a strong programming foundation.
1. How to Read & Draw Flowcharts
How to Read & Draw Flowcharts
A flowchart is a picture of an algorithm. Instead of writing out every step in words, you draw boxes for the steps and arrows that show the order in which they happen. Because the shapes are standardised, anyone who knows the symbols can read your plan — and you can read theirs.
Flowcharts are drawn top to bottom. You start at the top, follow the arrows, and finish at the bottom. Each shape has a specific meaning, so the shape itself tells you what kind of step it is.
The Symbol Legend
Here are the four symbols you will use again and again. Study the shape next to each label.
Rules for a Good Flowchart
- Exactly one Start. Every flowchart begins at a single Start terminator at the top.
- Arrows show the flow. Follow the arrowheads; they always point in the direction the steps happen (normally downward).
- Decisions have exactly two labelled exits. A diamond must have one arrow labelled Yes and one labelled No — never more, never fewer, never unlabelled.
- Every path ends. No matter which branch you take, the arrows eventually reach an End terminator.
- One entry, one action. A process box does one clear step. If a box is doing several things, split it.
- No dangling arrows. Every arrow must connect two shapes; nothing floats in mid-air.
Symbol → Meaning → Example
| Symbol | Name | Meaning | Example label |
|---|---|---|---|
| Oval | Terminator | Marks the start or the end of the algorithm | Start / End |
| Rectangle | Process | A single action, calculation or assignment | area = length × width |
| Diamond | Decision | A yes/no question with two outgoing branches | number > 0 ? |
| Parallelogram | Input / Output | Read a value from the user, or display a result | READ name / PRINT total |
| Arrow | Flow line | Shows the order steps are carried out | (points from one shape to the next) |
Keep these five shapes in mind. Every flowchart in this workshop is built from nothing more than these pieces joined by arrows.