Will compile on visual studios 2010...here is the link for C++ http://www.cramst
ID: 3625631 • Letter: W
Question
Will compile on visual studios 2010...here is the link for C++http://www.cramster.com/answers-feb-11/computer-science/guessing-game-rate-life-saver-compile-visual-studios-2010eac_1157392.aspx
Each funcion must have it's own function heading and prototype. Then there will be a function call in main. The idea is the program is suppose to be structured so that if you need to change one function it will be easier to do. Thanks.
Write a program that plays a number guessing game with the user. A sample run of the game program would be as follows(user input is in bold face:
Welcome to that game of guess it!
I will choose a number between 1 and 100.
You will try to guess that number. If you guess wrong I will tell you if you guessed to high or to low.
You will have 6 tries to guess the number.
OK, I am thinking of a number. Try to guess it.
Your Guess? 50
Too high!
Your guess? 12
Too low!
Your guess? 112
Illegal guess. Your guess must be between 1 and 100.
Try again. Your guess? -20
Illegal guess. Your guess must be between 1 and 100.
Try again. Your guess? 23
***Correct*****
Want to play again? y
Ok, I am thinking of a number. Try to guess it.
Your guess? 85
Too high!
Your guess? 12
Too low!
Your guess? 57
***Correct*****
Want to play again? N
Goodbye, it was fun.
Hope to play Guess it with you again soon.
....................................................................................................................................
Hint: Look up the library functions rand() and srand(). Use them to establish the number to be guessed so that the number will be different each time the game is played.