Answered step by step
Verified Expert Solution
Link Copied!

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 image text in transcribed

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 game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago