Exercise 6.35-6.37 Algorithm
Essay Preview: Exercise 6.35-6.37 Algorithm
Report this essay
Exercise 6.35-6.37 Algorithm
If the user answered the problem correctly or first question
Obtain two random integers.
Prompt the user for the product of the two numbers.
If the answer is wrong
Obtain a random integer for the random response.
Display the response corresponding to the random response integer.
[(1) No. Please try again. (2) Wrong. Try once more. (3) Dont give up!
(4) No. Keep trying.]
If the answer is right
Obtain a random integer for the random response.
Display the response corresponding to the random response integer.
[(1) Very good! (2) Excellent! (3) Nice work! (4) Keep up the good work!]
If the user types 10 answers, calculate the percent of correct responses.
If the percent is less than 75%, print, “Please ask your instructor for extra help”
and end program.
Repeat #1-2 while number of answers is less than 15 questions.
How much is 6 times 4 ? 18
No. Keep trying.
How much is 6 times 4 ? 24
Keep up the good work!
How much is 8 times 10 ? 80
Nice work!
How much is 10 times 0 ? 0
Keep up the good work!
How much is 1 times 5 ? 5
Keep up the good work!
How much is 0 times 5 ? 0
Nice work!
How much is 7 times 10 ? 70
Very good!
How much is 10 times 0 ? 0
Nice work!
How much is 11 times 4 ? 44
Nice work!
How much is 11 times 3 ? 33
Nice work!
How much is 5 times 6 ? 0
Wrong. Try once more.
How much is 5 times 6 ? 2
Essay About User And Random Integers
Essay, Pages 1 (226 words)
Latest Update: June 13, 2021
//= get_the_date(); ?>
Views: 98
//= gt_get_post_view(); ?>
User And Random Integers. (June 13, 2021). Retrieved from https://www.freeessays.education/user-and-random-integers-essay/