Menu

Java Guessing Game Class Class Generate Random Number 1 15 Check See User Guessed Number C Q43859934

Java Guessing Game Class

The class will generate a random number of 1 to 15, andthen check to see if the user guessed the number correctly. If thenumber is incorrect, the user should have the chance to guessagain, until they guess the right number or they guess 10 times.The class method should keep track of the number of guesses theuser has had, and return this value.  

The class should have one constructors, a default and adefined. The class should have a method to calculate the randomnumber. It should also have a method to check the guess to see ifit was correct. The guessing method should return a Boolean valueto determine if the user keeps guessing.  

The program should check for valid input. It shouldprint out either that the user’s guess was incorrect, printing outthe value the user last guessed and how many guesses it took; orthat the guess was correct, printing out how many guesses it tookto get the correct answer.

Expert Answer


Answer to Java Guessing Game Class The class will generate a random number of 1 to 15, and then check to see if the user guessed t…

OR