Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Counter and running total?

Também chamado de: counter · running total

Definition 18.2 Primary & Middle School Computer Science · Capítulo 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).
Ler no capítulo →