Question
Can you guess the computers number? We will follow a process to build a working program one at a time. A sample run of the
Can you guess the computers number? We will follow a process to build a working program one at a time. A sample run of the program follows. We will try to replicate its behavior exactly. Ive picked a random number from 1 to 100, try to guess it. Enter your guess: 50 Too high Enter your guess: 25 Too low Enter your guess: 37 Too low Enter your guess: 43 Too high Enter your guess: 40 You found it in 5 guesses! Building the program Write C++ code for each step of the process. 1. Setup your program with an empty main. 2. Add your include and using statements. 3. You need to have the computer pick a random number. If you include the random and chrono libraries the following code will genearte a random number from 1 to 100: std::default_random_engine generator(std::chrono::system_clock::now().time_since_epoch().count()); std::uniform_int_distribution
7. Write a block using conditionals that will tell the user if their guess was too high or too low. Note: you might need to change your answer to the previous questions. 8. Put the pieces together and run it. Test it to see if its what you have so far is working. 9. Add in code that counts the number of guesses and displays the final message to the user. Test and debug your program and submit your final version.
"Write the program in C++"
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