Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a method that generates two random integers vall and val2 between 1 and 9, and displays the question How much is [vall] times [val2]?.
Write a method that generates two random integers vall and val2 between 1 and 9, and displays the question How much is [vall] times [val2]?". The method returns the value of val1 * val2. For example, if val1 is 5 and val2 is 7, the method displays: How much is 5 times 7? Then, it returns 35. Write a main method that prompts the user to guess answer of a generated question. The program should repeat as much as the user wants. Finally, the program must displays the score of corrected answers. Sample run of the program How much is 6 * 7: 40 Incorrect answer. The correct answer is 42. Do you want to continue (y): Y How much is 3 * 7: 21 Correct answer. Do you want to continue (y): y How much is 2 * 4: 8 Correct answer. Do you want to continue (y): Y How much is 5 * 7: 35 Correct answer. Do you want to continue (y): Y How much is 8 * 9: 80 Incorrect answer. The correct answer is 72. Do you want to continue (y): Y Your score is 3/5
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