Question: While Loops (JAVA) Create a game where the player must guess a random number that is generated by the computer. You will need to decide

While Loops (JAVA)

Create a game where the player must guess a random number that is generated by the computer. You will need to decide the range of numbers that your program will use. Be sure to tell the user what that range is so that they can make a valid first guess. You will need to modify the getRandomNumber() code to reflect your range. Remember that nextInt( n ), where n is some value, returns a value from 0 (inclusive) up to n (exclusive). After the user enters a guess, tell them if their answer was correct, too low or too high. The program should loop until the user enters the correct value. After the user answers correctly, display a count of the number of attempts that it took. Save the file as RandomGuess.java.

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!