Question: Java Java Problem 1 Generate a random number between 1 and 10 After you generate the random number, prompt the user for a guess. First,

Java

Java Java Problem 1 Generate a random number between 1 and 10

Java

Problem 1 Generate a random number between 1 and 10 After you generate the random number, prompt the user for a guess. First, verify that the guess is between 1 and 10 If it is not, print an error message. Otherwise check whether the user has guessed the number. If so, print a congratulatory message. If the user has not guessed the number, display the number, then determine whether the guess was close. Define "close" as within three numbers. Print a message informing the user whether the guess was close, then wish the user better luck next time

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!