First exams 2027 · SL & HL 2027 年首次开考 · SL 与 HL

B1.1.4 · Approaches to computational thinking

B1.1.4 · 计算思维的方法

Tracing Flowcharts

追踪流程图

A flowchart is an algorithm you can actually see: a diagram, built from a small set of standard shapes, that shows exactly what order a program's steps happen in, and exactly which path it takes when it hits a decision.

流程图是一种真正看得见的算法:一种由少量标准形状构成的图形,准确展示程序步骤发生的顺序,以及遇到判断时究竟会走哪条路径。

Core for SL & HL SL 与 HL 核心内容 Typically 4–6 marks · AO2 通常 4–6 分 · AO2 Command term: trace 命令词:trace(追踪)

Explainer

讲解

By convention a flowchart's steps run downward the page, moving across into a new column only when the diagram genuinely needs one. All six standard symbols, at a glance:

按照惯例,流程图的步骤沿页面向下延伸,只有在图形确实需要时,才会横向移入新的一列。六种标准符号一览:

Worked example

示例讲解

Trace it yourself

自己动手追踪

A PE teacher wants to know how many of 5 students did 20 or more push-ups. The flowchart below reads each student's count in turn and keeps a running tally.

一位体育老师想知道 5 名学生中有多少人完成了 20 个或以上的俯卧撑。下面的流程图依次读取每名学生的次数,并持续累计计数。

Start COUNT←0, I←0 I < 5 ? Yes No Read PUSHUPS PUSHUPS ≥ 20 ? No Yes COUNT←COUNT+1 I←I+1 Output COUNT End

Reads top to bottom: initialise, then loop while I < 5, reading one student's count each time.

从上到下阅读:先初始化,然后在 I < 5 时循环,每次读取一名学生的次数。

Trace table: 5 students' push-up counts (18, 22, 25, 15, 20) Step 1 of 7

Before the loop starts: the two variables are initialised.

IPUSHUPSCOUNT
0—0

Pass 1 (I = 0): is 0 < 5? Yes. Read the first student's count, 18. Is 18 ≥ 20? No, so COUNT doesn't change. I becomes 1.

IPUSHUPSCOUNT
0—0
1180

Pass 2 (I = 1): is 1 < 5? Yes. Read the second count, 22. Is 22 ≥ 20? Yes, so COUNT increases. I becomes 2.

IPUSHUPSCOUNT
0—0
1180
2221

Pass 3 (I = 2): is 2 < 5? Yes. Read the third count, 25. Is 25 ≥ 20? Yes, so COUNT increases. I becomes 3.

IPUSHUPSCOUNT
0—0
1180
2221
3252

Pass 4 (I = 3): is 3 < 5? Yes. Read the fourth count, 15. Is 15 ≥ 20? No, so COUNT doesn't change. I becomes 4.

IPUSHUPSCOUNT
0—0
1180
2221
3252
4152

Pass 5 (I = 4): is 4 < 5? Yes. Read the fifth count, 20. Is 20 ≥ 20? Yes (equal counts as meeting it), so COUNT increases. I becomes 5.

IPUSHUPSCOUNT
0—0
1180
2221
3252
4152
5203

Loop check (I = 5): is 5 < 5? No. The loop ends here, and the final value of COUNT is output.

IPUSHUPSCOUNT
0—0
1180
2221
3252
4152
5203
Output3

Check your understanding

Using the same flowchart, what is the value of COUNT immediately after the THIRD student's count (25) has been processed?

Common mistake

A recurring drawing error flagged directly for this exact skill

RecurringA genuinely documented pattern: candidates draw a decision diamond correctly, with two lines leaving it, but forget to label which line means Yes and which means No. Without that label, a marker (or anyone else reading the flowchart) has no way to tell which path the algorithm actually takes when the condition is met.

✕ I < 5?

Two exits, neither labelled: Both lines leaving the decision diamond are drawn correctly, but neither says which answer sends the algorithm which way. A reader has to guess.

✓ I < 5?NoYes

Every exit labelled: Both lines carry a clear "Yes" or "No" (or "True"/"False"), so exactly one path is possible to trace at that decision, no guessing required.

Revision questions

Past-paper style. Write an answer, then reveal the marking points and mark yourself.

Question 1 · 2 marks

[2]Identify the flowchart symbol used to represent a yes/no question, and the symbol used to represent the start of an algorithm.

Question 2 · 3 marks

[3]State one reason why every branch leaving a decision symbol must be labelled.

Question 3 · 6 marks

[6]Trace the push-up counting flowchart above using the values 12, 20, 8, 30, 19 instead. Show the value of I, PUSHUPS and COUNT after each pass, and state the final output.

Flashcards

Active recall for this statement’s key terms.