Question: Write a program that plays the Hi-Lo guessing game with numbers. The program should generate a random number between 1 and 100 inclusive. It repeatedly

Write a program that plays the Hi-Lo guessing game with numbers. The program should generate a random number between 1 and 100 inclusive. It repeatedly asks the user to guess the number or to enter sentinel value 0 to quit (or stop guessing). On each guess, report to the user that he or she is correct or that guess is high, or low. Continue accepting guesses until user guesses correctly, or wants to quit. Count the number of guesses and report the number of guesses when the user guesses correctly or quits.

Use int variable secretNumber for the random computer generated number. Use int variable guess for each user guess, and use variable count for counting the number of guesses made by user.

SUBMIT: One word or PDF document named p6yourLastName with your name, cs151 section, and date of submission in the left upper corner. Include:

copy of the code,

flow chart diagram, and

two program runs.

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!