0 1 2 3
COUNT
works like the counters that guards use
at the entrance to museums.
Each time a visitor walks by, the guard clicks the counter
and the count goes up by one.
LET COUNT = COUNT + 1
is like one click of
the counter.
COUNT
is started out at zero, since, at the beginning of the
day zero visitors have come to the museum.
The example program repeats those two statements:
' Counting up LET COUNT = 0 'Statement 1 PRINT COUNT 'Statement 2 LET COUNT = COUNT + 1 'Statement 3 PRINT COUNT 'Statement 4 LET COUNT = COUNT + 1 'Statement 5 PRINT COUNT 'Statement 6 LET COUNT = COUNT + 1 'Statement 7 PRINT COUNT 'Statement 8 LET COUNT = COUNT + 1 'Statement 9 PRINT COUNT 'Statement 10 END
The program does the same two statements four times, then ends. What if you wanted the same two statements to be done again and again without end?
What feature of QBasic do you think can be used to keep repeating these same two statements?