Question
All that is needed is the CODE and it MUST be all done with C# in Visual Studio 2022 . Also, add comments to the
All that is needed is the CODE and it MUST be all done with C# in Visual Studio 2022. Also, add comments to the code to better explain it. The following additions MUST be added to the code as well. There are also other mandatory requirements below:
Make sure to have at least 3 methods in the app: "Main" method, a method that does the high/low check (Just the high/low check no looping. This method should return a Boolean to indicate if the number was guessed), and a method that calculates and displays the ending average.
Additions: - When the user guesses correctly, also display the number of guesses they took to get it right. - When all done (if user chooses not to play the game again), display the average number of times it took to get correct answers (i.e. if they played the game twice with the number of guesses to be 10 on the first game and the number of guesses to be 13 on the second game, the average would be 11.5). The average should be displayed with 2 decimal digits.
7.30 (Guess-the-Number Game) Write an app that plays "guess the number" as follows: Your app chooses the number to be guessed by selecting a random integer in the range 1 to 1000. The app displays the prompt Guess a number between 1 and 1000 . The player inputs a first guess. If the player's guess is incorrect, your app should display Too high. Try again. or Too low. Try again. to help the player "zero in" on the correct answer. The app should prompt the user for the next guess. When the user enters the correct answer, display Congratulations. You guessed the number! and allow the user to choose whether to play again. [Note: The guessing technique employed in this problem is similar to a binary search, which is discussed in Chapter 18.]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