Question: As we continue with our study of programming fundamentals, here is a short extra credit programming challenge involving repetition control structures. To be specific, the

As we continue with our study of programming fundamentals, here is a short extra credit programming challenge involving repetition control structures. To be specific, the program specifications below and the algorithm you develop and write will involve the set-up and use of both while and do-while loops. Random Number Guessing Game Write a program that generates a random number between 5 and 15 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. The program should use a loop that repeats while keeping a count of the number of guesses the user makes until the user correctly guesses the random number. Then the program should display the number of guesses along with the following message Congratulations. You figured out my number. Suggest that you also give the user the opportunity to play the game again or quit.

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