Flowcharts
Every step in a flowchart is drawn with a standard symbol, so its shape tells you the job that step does before you even read the label. These are the six symbols you need.
| Symbol | Shape | Used for |
|---|---|---|
| Terminal | Rounded rectangle | The start and the end of the algorithm, labelled Start and Stop (or End) |
| Input/output | Parallelogram | Data entering the algorithm, such as a value typed in, or data leaving it, such as a message shown |
| Process | Rectangle | A calculation or assignment that sets or changes a value, such as lives = lives - 1 |
| Decision | Diamond | A question with exactly two possible answers, such as Is the queue empty? |
| Sub program | Rectangle with an extra vertical line just inside its left and right edges | Run the named sub program at that point, such as shuffleDeck |
| Line | Arrow | Join two symbols and show which step follows which |
Keep the input/output and process symbols apart. A parallelogram is only for data crossing the edge of the algorithm, so a value being read in or a result being displayed belongs there. A plain rectangle is for work done inside the algorithm, like adding two marks together or storing a new high score. Getting these two the wrong way round changes what the flowchart says the program does.
The decision symbol is the one that shows selection. Only one question goes inside the diamond, and it must have exactly two possible answers, so the shape always has two exits. Label one exit Yes and the other No, or use True and False, and send each exit along its own separate path. A diamond with three exits, or with exits that are not labelled, cannot be followed reliably.
Lines are the arrows that join symbols and show the order of the steps. They normally run downwards. Every symbol is joined to the next by an arrow, and the Stop terminal is the only symbol with no arrow leaving it; a decision has two arrows leaving it, one for each exit.
OCR GCSE Computer Science · Flowcharts