Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a java program that: Develop a program that simulates the high-low game. For each execution of the program, the game will generate a random
Create a java program that:
Develop a program that simulates the high-low game. For each execution of the program, the game will generate a random number in the inclusive range of 1 to 100. The user will have up to 10 chances to guess the value. The program will keep track of all the user's guesses in an array. For each guess, the program will tell the user if his/her guess was too high or too low. If the user is successful, the program will stop asking for guesses, display the list of guesses, and show a congratulatory message stating how many guesses he/she took. If the user does not guess the correct answer within 10 tries, the program will display the list of guesses, and show him/her the correct value with a message stating that he/she was not successful. Regardless of the outcome, the program will give the user a chance to run the program again with a new random number. Method 1: A method that generates the random number to be guessed returns the random number to main. Two parameters are the two numbers needed to generate the random number (1 and 100 in this case) Method 2: This method tells the user if the guess is too low or too high. It will have 2 parameters one for the random number and the second is the user guess. Method 3: This method will get the user guess. It has 2 parameters which will be the valid range the user should guess between (in this case 1 and 100). It will return the users guess as an integer. This method should validate that the users guess is between the two parametersStep 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