All loops consist of a few basic components:
-
Initialization: Code that sets initial values before the
first iteration.
-
Condition: A Boolean expression that determines whether the loop
will iterate again or exit. The condition may be checked
at the beginning or the end of each iteration.
-
Body: The statements inside the loop that do useful work,
which are executed once during each iteration.
-
Housekeeping: Overhead (not useful work, but required) for
controlling the loop, such as incrementing a counter variable.
Without looking at the text, describe the four main components
of any loop.