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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started