Question 1 (4 mark) : Implement a program which helps the user to do some addition exercises.
REQUIREMENTS
• The user input is always correct (input verification is not
required).
• Your code must use do-while loop.
• In the main method, three random numbers [20,50] are generated as
the operands of the addition, the program will check whether the
answer is correct or not and displays corresponding information. It
then asks the user to continue the exercise or not and reads the
entered string. Each time when finishing the exercise, the number
of questions asked, the number of correct answers, and the accuracy
will be displayed.
• The accuracy shall be displayed with one decimal point
precision.
• Your code must work as the following example (the text in bold
indicates the user input).
Example of the program output:
Example 1:
44 + 25 + 31 = 100
Correct!
Will you continue addition exercises (Yes/No): No
The number of questions you have answered is 1 (1 correct), your
accuracy is: 100.0%
Example 2:
22 + 43 + 30 = 77
Wrong! The correct answer is 95.
Will you continue addition exercises (Yes/No): Yes
49 + 28 + 22 = 12
Wrong! The correct answer is 99.
Will you continue addition exercises (Yes/No): Yes
34 + 40 + 34 = 108
Correct!
Will you continue addition exercises (Yes/No): No
The number of questions you have answered is 3 (1 correct), your
accuracy is: 33.3%
Code must be in JAVA