SHuttle Launch JAva Program Class ShuttleLaunch 1000 millise

SHuttle Launch JAva Program

Class ShuttleLaunch {//1000 milliseconds = 1 second final static int SLEEP_TIME_MILLISECONDS = 1000; public static void main(String args[]) {String x = \"Hello!\ Welcome to the Shuttle Launch!\ \"; for(int i = 0; i

Solution

Following code will print desired output :-

final static int SLEEP_TIME_MILLISECONDS = 1000;
   static int number = 10;
   public static void main(String[] args) {   
  
       String x = \"Hello!\ Welcome to the shuttle launch!\ \";
       for(int i = 0; i < x.length() ; i++){
           System.out.print(x.charAt(i));
           try {
               Thread.sleep(SLEEP_TIME_MILLISECONDS/10);
           } catch (InterruptedException e) {
               System.out.println(\"Interrupted Exception!\");
           }
       }
       for(int y = number; y >= 0 ; y--){ //For loop to print numbers from 10 to 0
           System.out.println(\"I - \" + y);
           if(y == 2){
               System.out.println(\"Ignition...\");
               continue;
           }
       }
      
}

SHuttle Launch JAva Program Class ShuttleLaunch {//1000 milliseconds = 1 second final static int SLEEP_TIME_MILLISECONDS = 1000; public static void main(String

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site