Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, This question was previously answered. Thank you. Code Output Does Not Stop After Asking user f the number will he higher or lower. Additional
Hello, This question was previously answered. Thank you. Code Output Does Not Stop After Asking user f the number will he higher or lower. Additional help is appreciated.
Write a program that generates a random integer between 1 and 10 . Tell the user the number and ask him/her if they think the next number will be higher or lower. Record the user's response and generate a new number between 1 and 10 . Tell the user if he/she was right or wrong. Put your program in a loop that runs until the user gets 10 correct answers. How to get started: - See if you can generate a random number between 1 and 10 and print it to the screen. Run the program a few times and see if you're getting the right numbers. - Prompt the user to guess if the next number is higher or lower. - Generate the next number and print it to the screen. - Write an if else statement that determines if the user was correct or not. Tell the user the result. - Add a variable in your program that keeps track of the number of correct responses. This variable should be initialized to 0 . - Increment your variable when user gets an answer correct. - Put your code in a loop that continuously runs your code until the number of correct responses is 10
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