Question: In java, 1 . Create a method that will be used to play Guess a Number. This method will receive a String and a Random
In java,
Create a method that will be used to play Guess a Number. This method will receive a String and a Random object when called an object of type Random and will not return anything. In this method you will: create a new Scanner object, ask the user using their name to guess a number from to Randomly generate a number and see if the user got it correct. Let the user know the result.
When the user enters back in the main method, call the method created in #
send the user's name and the random object to the method.
When the user enters back in the main method, display "Thanks for playing! Please come back again!" Make sure the loop no longer executes.
When the user enters any number other than Display "Try again...".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
