Computer ScienceExam code: 0984

Pseudocode and Flowcharts

Algorithm Design and Problem Solving

A flowchart describes an algorithm visually. Each step is a labelled shape; arrows show the order steps are carried out in.

ShapeNameUsed for
Rounded rectangle (sometimes called a "stadium" or oval)TerminatorThe START and STOP of the program
ParallelogramInput / OutputReading data from the user, or printing it back to them
RectangleProcessA calculation, an assignment, or any other action that is not an input, output or decision
Diamond (rhombus)DecisionAn IF-style yes/no question that splits the flow into two branches
ArrowFlow lineShows the order in which steps run; arrows always have an arrowhead pointing in the direction of flow
Sub-routine box (rectangle with two extra vertical bars)Sub-routineA call to a procedure or function defined elsewhere
Small circleConnectorJoins two parts of a long flowchart without crossing lines
Flowchart symbol reference: rounded terminator symbols labelled START and STOP, parallelogram input/output symbols, rectangular process symbols including a sub-routine box, and a diamond decision symbol with Yes and No branches
Source: Algorithm by Save My Exams

Rules for a well-formed flowchart

  • Always start with a START terminator and end with a STOP terminator.
  • Every shape (except terminators) has exactly one arrow in and exactly one arrow out, except for decisions, which have one arrow in and two arrows out (labelled Yes / No or True / False).
  • Loops are drawn by having an arrow loop back to an earlier point. A decision diamond inside the loop ends it.
  • Arrows should not cross if it can be avoided; use circles to jump across long distances.

Common exam question

Drawing or completing a flowchart from a description

Question: A short program's requirements are listed (inputs, a check, a calculation or total, an output); draw a flowchart, or complete one whose START and STOP are printed, that carries them out (6 marks).

Asked in 3 of the 17 papers, always 6 marks, awarded point by point: correct symbols throughout, flow lines that are complete and work (both exits of every decision labelled Yes and No), the inputs, a decision for each required check, any calculation or totalling, and the output with its message. One scheme makes the prompt part of the input mark, so an OUTPUT asking for the value precedes each INPUT.

A count-controlled loop needs three visible parts: the counter set before the loop, increased inside it, and a decision that ends it, with an arrow looping back. Set a total to 0 before its loop. Symbol knowledge was also tested once on its own, by linking four symbols to their purposes.

A worked flowchart

The algorithm "ask for an age and welcome the user if they are 18+" puts every shape into action: a START terminator, an INPUT parallelogram for the age, a decision diamond with Yes/No branches, two output rectangles that rejoin, and a STOP terminator.

Worked flowchart: Start terminator, INPUT age parallelogram, a decision diamond IS age >= 18 with a Yes branch to an OUTPUT "Welcome to the site" and a No branch to an OUTPUT "Sorry, this site is for users 18 and over", both rejoining at a Stop terminator
Source: Algorithm by Save My Exams

Quick check

4 short questions on this note. See what has stuck, and where to look if something hasn't.

About 2 minutes

Build on this topic