Question: Complete the function named guess _ number ( k ) to guess an integer between 1 and 9 9 9 9 ( both included )

Complete the function named guess_number(k) to guess an integer between 1 and 9999(both included). This predefined integer k is passed to the function as argument. The user is prompted to enter a guess (It is assumed the entered guess is a positive integer.).
a.
If the users guess is out of the given range, user will get a Invalid input! message.
b.
If users input is within the range but is wrong then the prompt appears again until the guess is correct.
c.
On successful guess, user will get a Well guessed! message, and the program will exit. The prompt message is Enter number>.
Always print the entered number right after the users input.

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 Programming Questions!