Example 5-6 implements the Number Guessing Game program. If the guessed number is not correct, the program outputs a message indicating whether the guess is low or high. Modify the program as follows: Suppose that the variables
is
. If
is
is correct and the program outputs a message indicating that the user guessed the correct number. Suppose
. Then the program outputs the message as follows:
a. If diff is greater than or equal to 50, the program outputs the message indicating that the guess is very high (if guess is greater than num) or very low (if guess is less than num).
b. If diff is greater than or equal to 30 and less than 50, the program outputs the message indicating that the guess is high (if guess is greater than num) or low (if guess is less than num).
c. If
is greater than or equal to 15 and less than 30, the program outputs the message indicating that the guess is moderately high
is greater than
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.