Java Reference
In-Depth Information
CHAPTER
4
L
OOPS
Objectives
To write programs for executing statements repeatedly using a
while
loop (§4.2).
■
To follow the loop design strategy to develop loops (§§4.2.1-4.2.3).
■
To control a loop with a sentinel value (§4.2.4).
■
To obtain large input from a file using input redirection rather than typing
from the keyboard (§4.2.5).
■
To write loops using
do-while
statements (§4.3).
■
To write loops using
for
statements (§4.4).
■
To discover the similarities and differences of three types of loop state-
ments (§4.5).
■
To write nested loops (§4.6).
■
To learn the techniques for minimizing numerical errors (§4.7).
■
To learn loops from a variety of examples (
GCD
,
FutureTuition
,
MonteCarloSimulation
) (§4.8).
■
To implement program control with
break
and
continue
(§4.9).
■
To write a program that displays prime numbers (§4.10).
■
To control a loop with a confirmation dialog (§4.11).
■