全部书籍

专业

应用 关于 Coach 登录 开始阅读

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

Computer Science · 术语表

什么是 Counter and running total?

又称: counter · running total

Definition 18.2 Primary & Middle School Computer Science · 第 18 章 — Repeating with while

A counter is a variable that starts at 0 and goes up by 1 each time something happens. A running total is a variable that starts at 0 and adds each new value as it comes.

The trace of  as a filling bar: one row per turn of the loop. The test coins < 50 is still true after week 16 (48 coins), and false after week 17 (51 coins).
The trace of Listing 18.2 as a filling bar: one row per turn of the loop. The test coins < 50 is still true after week 16 (48 coins), and false after week 17 (51 coins).
在原文中阅读 →