Embed presentation
Download to read offline
![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;
}
}
}](https://image.slidesharecdn.com/shuttlelaunchjavaprogramclassshuttlelaunch1000milliseconds-230702112433-118c076c/75/SHuttle-Launch-JAva-Program-Class-ShuttleLaunch-1000-milliseconds-pdf-1-2048.jpg)
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 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;
}
}
}](https://image.slidesharecdn.com/shuttlelaunchjavaprogramclassshuttlelaunch1000milliseconds-230702112433-118c076c/75/SHuttle-Launch-JAva-Program-Class-ShuttleLaunch-1000-milliseconds-pdf-1-2048.jpg)