Question: You are to write a program that randomly generates a number between 1 and 50. and gives the user 5 guesses to try to guess

 You are to write a program that randomly generates a number

You are to write a program that randomly generates a number between 1 and 50. and gives the user 5 guesses to try to guess the number. Each time they miss, tell them whether their next guess should be higher or lower. Have 5 different messages (preferably humorous as this is a game) to be displayed depending on when they either guess the correct number, or miss all 4 guesses. Note: if they guess correctly at some point, don't ask for more guesses. Sample Output: I am thinking of a number between 1 and 50. Try to guess it! Guess 1: (they type a number here) Sorry, try higher. Guess 2: (they type a number here) Sorry, try lower. Guess 3: (they type a number here) Yes! It only took you 3 guesses! Would you like to play again? (y) After they play a complete game, ask if they want to play again. Let them play as many games as they like until they choose to quit. What to submit: Submit source code via email. If you are absent, it is still your responsibility to submit on time. Put group members last names in the subject line. Keep in mind the following: Name your source file main.c. With invalid data, your program should respond appropriately. Test your code when you think you are finished. Try to break it. After you are done trying to break it, I will then try

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!