Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started