Chapter 4 · Simulation

Flowchart Runner

← Chapter 4

Flowchart runner

Goal: See how a computer “executes” a flowchart: which box runs, which arrow is followed, and how the variables and the screen output change.

SymbolRole
OvalStart / End
RectangleProcess (calculation, assignment)
DiamondDecision: two exits, Yes / No
ParallelogramInput / output (read, print)

How to use it

  1. Pick an example and type the input values (Enter or Apply).
  2. Use Step ▶ to move to the next box; the followed arrow and the running box turn orange. ◀ Back undoes one step, Play runs it automatically.
  3. In the variable table the value that changed in that step is highlighted; print boxes add a line to the output area.
  4. If Predict the decisions is ticked, the run stops at every decision box; predict whether the Yes or the No path will be taken.

In the loop examples the arrow that goes back (repeat) asks the same decision again; without the process that changes the condition (i = i + 1) the loop would never end. In the sum from 1 to n, i is the counter and sum is the accumulator.

Related slides: Chapter 4.2 · Flowcharts and Chapter 4.1 · Algorithms (prime number, factorial).