Question: Pgm 1 9 . Random Number Guessing Game Write a full program that generates a random integer in the range of 1 through 1 0
Pgm Random Number Guessing Game
Write a full program that generates a random integer in the range of through inclusive; and asks
the user to guess what the number is 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. If the user guesses the number, the application should congratulate
the user and generate a new random number so the game can start over.
Some rules to make life much easier:
Do at least numbers per game less than are trivial
For each number, make at least guesses.
Limit the number of guesses to for each number.
Do the following as part of this programming exercise:
Keep count of the number of guesses that the user makes for each number.
When the user correctly guesses the random number, the program should display the number of
guesses that were needed.
Write the number and number of guesses to a new output file for each game.
When the user wants to start a totally new game, not a run, close the output file.
Process the output file as a separate program:
Read each entry in the file and total the number of guesses for each use.
When finished processing, print out the total number of guesses and print out the average
number of guesses for the game.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
