Three small programs to practice while, do/while, and for loops
Workbook 2a, p.63
Three separate programs, each using a different loop type. Program 1 (WhileLoop):
Use a while loop to print "I love Java!" five times. Program 2
(DoWhileLoop): Do the same thing using a do/while loop. Program 3
(ForLoop): Use a for loop to count down from 10 to 1, then print "Launch!"
with a 1-second delay between each number.
Thread.sleep() — it takes milliseconds, so 1 second = 1000.
This exercise reinforces these concepts from Week 2:
Each program follows a similar pattern but uses a different loop structure:
Programs 1 and 2 produce identical output. The difference is in the loop structure, not the result.