Guessinggame2

The original program is attached
• Use the guessing game program developed in Week Two.

• Move the guess response (the part that determines if the guess is too high or too low) functionality into a function that you write.. The function must have the prototype int reviewGuess(int, int), where the function takes the random number generated by the computer as the first parameter and the number guessed by the user as the second parameter. If the numbers match, the function will return a value of zero. If the number is too high, the function will return a value of 1. If the number is too low, the function will return a value of -1.

• Replace this code in the body of your program with a switch statement. When the user successfully guesses the number, prompt if he or she wants to play again. If so, have the computer choose a new random number.

Leave a Reply

Your email address will not be published. Required fields are marked *