Question: Problem A: Number guessing game (20 points) Write a C++ program to do the following number guessing game. First, the computer should ask you to


Problem A: Number guessing game (20 points) Write a C++ program to do the following number guessing game. First, the computer should ask you to enter a "seed" value (see below). Then pick a random number from 1 to 9 without telling you the number. You get three chances to try and guess the number the computer picked. After you make one of your guesses, the computer should tell you one of the following statements: 1. "Close!" if you are within 1 of correct answer. 2. "Too low!" if you are below the number and not within 1. 3. Too high! if you are above the number and not within 1. 4. "Correct!" if you guessed the number exactly. If the player has not guessed the correct number after 3 tries, inform the player that they lost the game, tell them the correct answer and end the program. If the user correctly guesses the number("Correct! above), end the program. Important: Make sure your first lines of code in main() are as shown below to ask for the seed and setup the random number (i.e. variable "random"): int seed; cout > seed; srand (seed); int random = rand() % 9+1; If you do not follow this process, or generate a random number in a different way, you will probably not pass the test cases. You should also add this include at the top: #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
