c++ Write a program that plays the game of \"guess the number\" as follows: Your
ID: 3757506 • Letter: C
Question
c++
Write a program that plays the game of "guess the number" as follows: Your program chooses the number to be guessed by selecting an integer at random in the range 1 to 100. The program then types: I have a number between 1 and 100. Can you guess my number? Please type your first guess. The player then types a first guess. The program responds with one of the following 1. Excellent! You guessed the number! 2. Too low. Try again. 3. Too high. Try again. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too high or Too low to help the player "zero in" on the correct answer. (Note: The search technique employed in this problem is called binary search in computer science.)Explanation / Answer
#include #include #include using namespace std; int main() { srand(time(NULL)); int guess, number = 1 + (rand() % 100); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.