Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I'm currently in a C++ course. My professor gave us this assignment but I'm confused on how I can write this program without using

Hello, I'm currently in a C++ course. My professor gave us this assignment but I'm confused on how I can write this program without using the cin function so the computer can guess the number. Can somebody please help me. REMINDER: the computer has to guess the number the user is thinking of, and the user has to also type in whether the number is high or low to the number they are thinking. Thank You !
image text in transcribed
this assignment, you are to write aprogram that guesses what you have in your mind. No, computers can't read your mind, but at least guess a number you have in mind given that you tell the program whether the number the program guessed is higher or lower than your number. Since humans are much more creative than the computer applications, we will level the playing field by limiting the number we select to be in between 1 and 100. The program should work as following 1. You will pick a number between 1 and 100. This number should never be used in your program 2. The program should pick a random number in between 1 and 100 3. The program asks user whether the number is comect, higher, or lower. 4. If it is the correct guess, print "Correct guess" and exit out of the program. 5. If not correct, answer"h", or "I" to indicate the guess is either higher or lower than the correct number. 6. If lower, then the next number should be higher than the previous guess. 7. If higher, then the next number should be lower than the previous guess. Repeat steps 3 through 7 until the comect guess is made. 9. The program should keep track of the number guesses made until the correct 10. Capture screen outputsofall guesses and responses along with the final number taken, guesses Submit your source code and output screen capture

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

What are the attributes of a good requirement?

Answered: 1 week ago

Question

6. Conduct a cost-benefit analysis for a training program.

Answered: 1 week ago