Question: IN JAVA: Write a program that prompts the user for a number, reads in the value (say n) from the user and outputs the string

IN JAVA: Write a program that prompts the user for a number, reads in the value (say n) from the user and outputs the string Hello World X n times (e.g., If the input is 3, the output will be Hello World X, without the quotation marks, printed three times), where X is the loop iteration number, starting with 1. You must use a WHILE loop to do this. End the program with a Goodbye. HINT: You will need to make a counter that counts up in each loop iteration. Sample Input/Output The following below shows an example of what your console interaction should look like for a given example. Your output should match the output here exactly. Text that is bold represents text that is input to the program by the user.

How many times would you like to print "Hello World"?

5

Hello World 1

Hello World 2

Hello World 3

Hello World 4

Hello World 5

Goodbye.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!