Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use c++ please. thanks Question 2: Implement a number guessing game. The program should randomly choose an integer between 1 and 100 (inclusive), and have
use c++ please. thanks
Question 2: Implement a number guessing game. The program should randomly choose an integer between 1 and 100 (inclusive), and have the user try to guess that number. Implementations guidelines: 1. The user can guess at most 5 times. 2. Before each guess the program announces: An updated guessing-range, taking into account previous guesses and responses. The number of guesses that the user has left. 3. If the user guessed correctly, the program should announce that, and also tell how many guesses the user used. 4. If the user guessed wrong, and there are still guesses left, the program should tell the user if the number (it chose) is bigger or smaller than the number that the user guessed. 5. If the user didn't guess the number in all of the 5 tries, the program should reveal the number it chose. 6. Follow the execution examples below for the exact format. In order to generate random numbers (of type int), you should first call the srand function (one time) to initialize a seed for the random number generator. Then, you can call the rand function repeatedly to generate random integers. Follow the syntax as demonstrated in the code below: 1. #include 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