Unit 1 · Basics of Computer Programming

1.2.1Symbols and rules

A flowchart only works if everyone reads the symbols the same way. That is why the symbols are standard: a diamond always means a decision, whoever draws it.

Standard symbols

SymbolNameUse
Oval (rounded rectangle)TerminatorStart and Stop
RectangleProcessCalculations and assignments, for example total = total + i
ParallelogramInput/OutputRead a value or display a result
DiamondDecisionA yes/no question with two exits
ArrowFlow lineShows the direction of flow
Small circleConnectorJoins parts of a chart or continues on another page
StartTerminatorStart and Stoptotal = total + iProcesscalculation or assignmentREAD a, bInput / Outputread or displaya > b ?Decisionyes/no question, two exitsFlow linedirection of flowAConnectorjoins parts of a chart
The standard flowchart symbols

What goes inside each symbol

Rules for drawing flowcharts

The three structures as flowcharts

Each building block from 1.1.2 has its own shape in a flowchart:

You will see all three in the worked examples in 1.2.2.

How to read a flowchart

Put your finger on Start and follow the arrows. At each process box, write down the new value of each variable. At each diamond, work out the answer with the current values and follow that exit. Stop when you reach Stop. This is exactly a dry run, and it is how you check a flowchart before coding it.

Common mistakes: a decision with only one exit; arrows without heads; two Start symbols; an action written inside a diamond; a loop that has no way out; and lines that cross because the chart was not planned. Check every flowchart against the rules above before you hand it in.

Remember

  • Oval for Start/Stop, rectangle for process, parallelogram for input/output, diamond for decisions.
  • Every diamond has exactly two labelled exits.
  • A loop is drawn as an arrow back to a point before the decision.