← IB Computer Science

Flowcharts and tracing algorithms

A flowchart depicts a process, its decisions and its flow of control, and it can represent the logic of a program so you can trace it. This unit covers the standard flowchart symbols and how to trace a flowchart to follow execution, track variable changes and work out the output. (This is B1.1.4, common to SL and HL, with no AHL-only material.)

Slide 1 / 4

Standard flowchart symbols

Standard flowchart symbols (ISO 5807)Start / EndTerminalrounded, start or endx = x + 1Processrectangle, an operationRead / PrintInput / Outputparallelogramx>0?Decisiondiamond, a yes/no testFlowlinearrow, order of stepsAConnectorjoins parts of a chart
  • Flowcharts generally flow from top to bottom and left to right, and the standard symbols are set by ISO 5807.
  • A terminal (start or end) is a rounded shape, a process or operation is a rectangle, and input or output is a parallelogram.
  • A decision is a diamond, and a flowline is an arrow that shows the order of operations.
  • A connector is a small circle used to join parts of a large flowchart without drawing long lines.

Check you've got it

0/4

1. In a standard flowchart, which symbol is used for a decision with two possible outcomes, such as a yes/no question?

2. What does a parallelogram represent in a standard flowchart?

3. A flowchart sets A = 2 and B = 20. It then repeats these steps: check "is A greater than B?"; if the answer is no, do B = B - 4 then A = A + 2 and check again; if the answer is yes, stop. How many times does the pair of updates (B = B - 4, A = A + 2) run before the program stops?

4. A flowchart sets X = 5 and COUNT = 0. It then repeats: check "is X equal to 0?"; if no, do X = X - 1 then COUNT = COUNT + 2 and check again; if yes, output COUNT. What value is output?

Free revision content. Multiple-choice answers are marked instantly. Written answers are marked by AI on /free-mark.