Question: Write a random number guessing game. When the program starts, the user should be asked to enter a maximum number (maxNum) for the range of
Write a random number guessing game. When the program starts, the user should be asked to enter a maximum number (maxNum) for the range of numbers to be considered. The program should then generate a random number (integer, from 1 to maxNum) and asks the user to guess what the number is in the range of 1 to maxNum. If the users guess is higher than the random number, the program should display Too high, try again.. If the users guess is lower than the random number, the program should display Too low, try again.. The program should use a loop that repeats until the user correctly guesses the random number. Input Validation: Do not accept values of 1 or less for the maxNum NOTE: Sample code for generating a random number between 1 and maxNum can be found on page 130-131 of the assigned text book. Remember: For each problem, include several test runs of the program to show successful runs of your program, with both valid and invalid data (to show that you are checking for invalid data) Please ensure the program is well designed and follows accepted style guidelines (e.g. variable naming, indentation, spacing). Please ensure the program is well documented, including the overall purpose of the program and documenting all the major sections of the code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
