Question
Guess-the-Number Game Expanded Write an app that plays guess the number as follows: The app will play the game itself. It will choose a random
Guess-the-Number Game Expanded
Write an app that plays guess the number as follows:
The app will play the game itself. It will choose a random number between 1 and 100, then it will try to guess the number using an algorithm you write.
Rules
1.The random number generator will be enclosed in its own class. A constructor will generate the private random number upon object instantiation. The class must have at least a get property so the random number can be retrieved. But do not assign the value to a variable outside its class. Feel free to use a struct instead of a class if you want.
2.A method will hold the algorithm for guessing the number. Use an array to track all the guessed numbers. Allow only 10 attempts, so the array needs to be 10 elements.
3.Upon completion, display the random and each array element sequentially (to show the guesses).
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