Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Counter and running total?

Dikenal juga sebagai: counter · running total

Definition 18.2 Primary & Middle School Computer Science · Bab 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).
Baca dalam konteks →