Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

🎯 Objective

Instructions:

  1. Create a new Java file named Countdown.java. This is the class where you'll implement the countdown logic.

  2. In the Countdown class, define three methods: doWhileCountdown(), whileCountdown(), and forCountdown(). Each method will implement the countdown using a different loop structure.

  3. Implement the doWhileCountdown() method using a do-while loop, whileCountdown() method using a while loop, and forCountdown() method using a for loop. Each method will count down from 10 to 1 and then print "Blastoff".

  4. Now, create another Java file named CountdownApp.java. This will contain your main method, and you'll use it to create an instance of the Countdown class and call each of its methods.

...

Code Block
10
9
8
7
6
5
4
3
2
1
Blastoff!

10
9
8
7
6
5
4
3
2
1
Blastoff!

10
9
8
7
6
5
4
3
2
1
Blastoff!

🚚  Deliverables

Upload the following files in a zip folder that you have created:

...