Flowcharts
A flowchart is a visual representation of the sequence of steps in an algorithm or process. Unlike DFDs (which show data movement), flowcharts show the order of operations, including decisions and loops.
Learning Objectives
- 11.2.1.7 Draw and interpret flowcharts for computing systems
Conceptual Anchor
The GPS Directions Analogy
A flowchart is like GPS turn-by-turn directions. "Go straight" (process), "Turn left at the junction?" (decision — Yes/No), "You've arrived" (end). Each step leads to the next, and decisions create different routes. Flowcharts work the same way for algorithms.
Rules & Theory
Standard Flowchart Symbols
| Symbol | Shape | Meaning | Example |
|---|---|---|---|
| Terminator | Rounded rectangle (oval) | Start or End | START, END |
| Process | Rectangle | Action or calculation | sum = a + b |
| Decision | Diamond ◇ | Yes/No question | Is x > 10? |
| Input/Output | Parallelogram | Read input or display output | INPUT name, PRINT total |
| Arrow | → | Flow direction | Connects symbols in order |
| Connector | Small circle | Joins separate parts of flowchart | Used when flowchart spans pages |
Flowchart Rules
| # | Rule |
|---|---|
| 1 | Every flowchart starts with a START terminator and ends with an END terminator |
| 2 | Flow goes top to bottom, left to right (generally) |
| 3 | Arrows connect all symbols — no "floating" shapes |
| 4 | Decision diamonds must have exactly two outputs: Yes and No |
| 5 | Use standard shapes — don't invent your own |
| 6 | Write inside symbols, not beside them |
Example: Is a Number Even or Odd?
╭─────────╮
│ START │
╰────┬─────╯
↓
┌──────────────┐
│ INPUT number │
└──────┬───────┘
↓
◇──────────◇
│ number │
│ MOD 2 = 0? │
◇──────────◇
Yes ↓ No ↓
┌────────┐ ┌──────┐
│ PRINT │ │ PRINT│
│ "Even" │ │ "Odd"│
└───┬────┘ └──┬───┘
└─────┬────┘
↓
╭──────────╮
│ END │
╰──────────╯Example: Sum Numbers Until User Enters 0
╭─────────╮
│ START │
╰────┬─────╯
↓
┌──────────┐
│ sum = 0 │
└────┬─────┘
↓
┌──────────────┐ ←──────────┐
│ INPUT number │ │
└──────┬───────┘ │
↓ │
◇──────────◇ │
│ number │ │
│ = 0? │ │
◇──────────◇ │
Yes ↓ No ↓ │
│ ┌───────────┐ │
│ │ sum = sum │ │
│ │ + number │ │
│ └─────┬─────┘ │
│ └──────────┘
↓
┌──────────────┐
│ PRINT sum │
└──────┬───────┘
↓
╭──────────╮
│ END │
╰──────────╯Flowchart vs Pseudocode
Both represent algorithms. Flowcharts are visual — better for understanding flow and presenting to non-programmers. Pseudocode is text-based — better for programmers and closer to actual code.
Common Pitfalls
Using Wrong Shapes
Using a rectangle for input/output is wrong — use a parallelogram. Using a rectangle for decisions is wrong — use a diamond. Each symbol has a specific meaning.
Forgetting the Loop-Back Arrow
In loops, you need an arrow going back up to the loop condition. Without it, the flowchart only runs once — it's not a loop!
Tasks
Draw all 6 flowchart symbols and label each one.
Draw a flowchart that inputs a student's mark and outputs "Pass" (≥50) or "Fail" (<50).< /p>
Draw a flowchart that finds the largest of 3 input numbers.
Convert this flowchart problem into pseudocode: Input numbers until -1, counting how many are positive.
Self-Check Quiz
Q1: What shape is used for decisions?
Q2: What shape is used for input/output?
Q3: How is a loop shown in a flowchart?