Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need to write a program that is a guessing game using while loops and pseudorandom numbers. Program needs to include the following static methods. A
Need to write a program that is a guessing game using while loops and pseudorandom numbers. Program needs to include the following static methods. A method that introduces the game to the user. A method to play one game with the user. A method to report overall results to the user. Also needs to include a class constant to change the maximum number used in the game. Restrictions are no use of arrays lists or classes since we have yet to go over those topics. A sample output is attached
This program allows you to play a guessing game I will think of a number between 1 and 100 and will allow you to guess until you get it. For each guess, I will tel1 you whether the right answer is higher or lower than your guess I'm thinking of a number between 1 and 100. Your guess? 50 It's lower Your guess? 25 It's lower Your guess?12 It's lower Your guess?6 You got it right in 4 guesses Do you want to play again? y I'm thinking of a number between 1 and 100. Your guess?50 It's lower Your guess?25 It's lower Your guess?12 It's higher. Your guess?18 You got it right in 4 guesses Do you want to play again? YES I'm thinking of a number between 1 and 100. Your guess? 50 It's higher. Your guess?75 It's lower Your guess?62 It's higher. Your guess?68 It's lower Your guess? 65 It's higher. Your guess?66 It's higher. Your guess?67 You got it right in 7 guesses Do you want to play again? nope Overall results total games 3 total guesses 15 guesses/game 5.0 best gameStep 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