Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Counter and running total » ?

Aussi appelé : counter · running total

Definition 18.2 Primary & Middle School Computer Science · Chapitre 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).
Lire dans le chapitre →