Question: Write a program that continuously displays two numbers between 0 and 100 and waits for the user to enter the sum of the two numbers.

Write a program that continuously displays two numbers between 0 and 100 and waits for the user to enter the sum of the two numbers. If the sum is wrong then stop and display the count of how many they got right. (HINT: You do not need to use a break statement to exit the loop)

Input Format An integer containing the users sum.

Output Format If the user gets the sum correct then display correct and move on to the next random problem. If the user gets a sum incorrect then stop and display the count of the number of sums they got right.

Sample Run

93+60=153 Correct! 55+16=71 Correct! 37+11=48 Correct! 57+96=151 Correct Solutions: 3

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!