全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Trace table?

Definition 15.5 Primary & Middle School Computer Science · 第 15 章 — Variables and Input

A trace table is a table that follows a program by hand: one column for each variable, one row for each line run, holding the values of the variables after that line.

示例

Example 15.6 (Tracing five lines)

A dash means that the variable has no value yet.

lineinstructionab
1a = 55–
2b = a + 358
3a = b * 2168
4b = b - a16−8-8
5print(a, b)16−8-8

The program should print 16 -8. Running it confirms the table:

在原文中阅读 →