Question: C++ code (50 pts) You will be writing a number guessing game where the user is asked to pick a number 1-10 which will be

C++ code  C++ code (50 pts) You will be writing a number guessing

(50 pts) You will be writing a number guessing game where the user is asked to pick a number 1-10 which will be checked against a randomly generated number 3. The user will continue guessing until they guess the correct answer. . If the user does not guess correctly, the program will tell the user if the secret number is higher or lower than the number the user selected. Refer to the prelab 3 example if you forgot how to generate a random number. Don't forget to include "ctime" and "cstdlib" libraries. Make sure you check for bad numeric data. If the user enters invalid data, continuously prompt the user until they enter a valid number. . Sample Output: Guess a number 1 10: 5 The secret number is larger than 5 Guess a number 1 10: 11 ERROR: Enter a number1 10:6 The secret number is larger than 6 Guess a number 1 10:8 The secret number is smaller than 8 Guess a number 1 10:7 BINGO!! You guessed the secret number in 4 tries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!