Information Technology • Algorithms and Flowcharts

Flowchart Runner

The flowchart

Flowchart Runner — Explanation

How to use it. In Run, choose a flowchart, type its input values (separated by commas) and press Step to run one box at a time, or Run to watch it go. The box being run is lit up and the line just taken is highlighted. The trace table records every value as it changes, and the outputs appear below it. In Build, change a flowchart or make your own: each box's type, its words, and where its lines go. Challenges asks you to predict outputs and to find the mistake in a flowchart.

The symbols

Lines (flow lines) have arrows showing the order. Assignment is written with ← (here <- works too). Text in quotes is output as it is; the items in an OUTPUT are output one after another.

Tracing

A dry run works through an algorithm by hand, recording each variable in a trace table: a new value goes in the variable's column when it changes, and anything output goes in the OUTPUT column. It shows what an algorithm does and finds logic errors, such as a comparison the wrong way round, a variable never increased, or a loop that runs once too often or too few times (an off-by-one error). Test with normal, boundary (such as exactly 50 for a pass mark of 50) and extreme or invalid data.

Common exam mistakes: forgetting to initialise a total or counter (set it to 0 before the loop); adding the rogue value (such as −1) into the total; using > where the question means ≥; a decision with only one exit, or exits not labelled Yes and No; and no STOP.

Objective: Cambridge International AS & A Level Information Technology (9626), algorithms: flowcharts with sequence, selection and iteration, tracing them with test data, and finding and correcting errors. Also useful for IGCSE ICT (0417).

Where this fits

  • AP: AP Computer Science Principles
  • Cambridge: Cambridge IGCSE Computer Science (0478); Cambridge A Level Computer Science (9618); Cambridge AS Level Computer Science (9618); Cambridge A Level Information Technology (9626); Cambridge AS Level Information Technology (9626)
  • IB: IB Computer Science HL; IB Computer Science SL
  • NCEA Level 1 Digital Technologies: 92004 Create a computer program; 92004 Create a computer program Goes beyond 92004: 92004 assesses writing a program; this teaches the constructs and testing through flowcharts, not coding. Goes beyond 92004: 92004 assesses writing a program; this teaches the constructs and testing through flowcharts, not coding.
  • Pearson Edexcel International: Edexcel International GCSE Computer Science (4CP0); Edexcel International A Level Information Technology
  • USDP: USDP Computer Science

Flowchart Runner — Key Terms

Key concepts in English, with te reo Māori, Chinese (Simplified) and Korean.

EnglishTe reo Māori中文(简体)한국어What it means on this page
Flowcharthoahoa rerenga流程图순서도A diagram that shows an algorithm using standard shapes for start/end, actions, decisions and input/output.
Algorithmhātepe算法알고리즘A precise sequence of steps for solving a problem: what each flowchart on this page describes.
Variabletāupe变量변수A named location that holds a value which can change while the algorithm runs — the columns of the trace table.
Trace tableno attested term追踪表추적표A table used to record the value of each variable, row by row, as an algorithm is dry-run by hand.
Selectionno attested term选择结构선택 구조A decision point where the algorithm follows one of two or more branches — IF or CASE, or a decision box in a flowchart.
Iteration (loop)koromeke循环(迭代)반복(루프)A block of steps that repeats — FOR, WHILE or REPEAT — while or until a condition holds.
Conditionno attested term条件조건An expression that is tested and evaluates to TRUE or FALSE, used to control a selection or iteration.
Dry runno attested term人工跟踪수동 실행Working through an algorithm by hand, one step at a time, to see what it does — exactly what this page trains.
Rogue Valueno attested term终止值 (zhōngzhǐzhí)종료값 (jongryogap)A special input value, such as −1, that is not real data and is used to stop a loop.
Logic Errorno attested term逻辑错误 (luójí cuòwù)논리 오류 (nolli oryu)A mistake in an algorithm that lets it run but gives the wrong result, such as a comparison the wrong way round.
Boundary Datano attested term边界数据 (biānjiè shùjù)경계 데이터 (gyeonggye deiteo)Test data at the edge of what is allowed, such as exactly 50 for a pass mark of 50, to check the comparisons.

On the te reo Māori column. Terms marked as gaps have no attested equivalent in the sources checked — Karaitiana Taiuru's Dictionary of Māori Computer and Social Media Terms, Paekupu, the Reserve Bank's te reo financial glossary, NZQA and Te Aka. No coinage is printed as though it were established; where a class needs one, commission it from Te Taura Whiri i te Reo Māori and credit the translator. Te reo Māori is not italicised and takes no plural "s".