Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago

Question

Distinguish between poor and good positive and neutral messages.

Answered: 1 week ago

Question

Describe the four specific guidelines for using the direct plan.

Answered: 1 week ago