Question: Computers are playing an increasing role in education. Write a Java application program that will help an elementary school student learn multiplication. Use a Random
Computers are playing an increasing role in education. Write a Java application program that will help an elementary school student learn multiplication. Use a Random object to produce two positive one digit integers. The program should then prompt the user with a question, such as
How much is 6 times 7?
The student then inputs the answer. Next, the program checks the students answer. If it is correct, display one of the following the messages and ask another multiplication question.
Responses to a correct answer:
- Very good! 2. Excellent! 3. Nice work! 4. Keep up the good work!
If the answer is wrong, display one of the following message the messages and also provide a correct answer.
Responses to an incorrect answer:
- No. Please try again. 2. Wrong. Try once more. 3. Don't give up! 4. No. Keep trying.
You could use random-number generation to choose a number from 1 to 4 that will be used to select an appropriate response to each answer and use a switch statement to issue the responses.
After the user enter -1 to exit the program. The program should print out all the questions, answers to those questions, remark to the wrong questions, statistics information about number of questions answered and answered incorrect, and a little remark. If the user has more than one third of the questions are wrong the remark should randomly choose from Responses to an incorrect answer, otherwise it should randomly choose from Responses to a correct answer.
A class (Multiply3 as in this assignments demo programs) should be implemented to do all of the above and in the class separate methods should be used to generate each new question and response to the correct or incorrect answers. These methods should be called once when the application begins execution and each time the user answers the question correctly or incorrectly.
In the main function (Multiply3Test.java as in the demo) just instantiates the created class to get to the interactive questions and answer. It also calls the printQuestionResult function in the Multiply3 class to display all the questions asked and provide the requested result.
There is a 100 by 5 two dimensional integer array to store up to 100 multiplication questions in the Multiply3.java.
Functions needed to create in the Multiply3.java are quiz, createQuestion, createResponse, checkResponse, and printQuestionResult.
1. The quiz function is a public function. It does not take and return anything. It generates interface to ask user to answer multiplication problems, and call createQuestion and checkResponse.
2. The createQuestion function is a public function. It does not take and return anything. It generates a new multiplication question.
3. The createResponse function is a public function. It takes a boolean data and return a string. If it gets a false input it will return No. Please try again.", Wrong. Try once more, or etc. If it gets a true input is will return Very good!, Excellent!, or etc.
4. The checkResponse function is a public function. It takes integer input and does not return anything. It checks if the user answered correctly, calls the createResponse function to generate response print out, and calls the createQuestion function to generate question.
5. The printQuestionResult function is a public function. It does not take and return anything. This function prints out the questions, answers, statistics information and comment.
This assignment comes with a CISP401V11A3.zip file. It includes two files (Multiply3Test.class and Multiply3.class.) Both of the Multiply3Test.class and Multiply3.class are executable files. You can place them in a sub folder (directory). Bring up a command prompt and go to the sub directory, type java Multiply3Test in the sub directory and hit Enter key. You should see the program run. If you put in proper information you should get to the result in the following pictures.

Please include the picture of source code for both Multiply3Test.java and Multiply3.java files separately.
How much is 2 times 2? Enter your answer (-1 to exit): 0 No. Please try again. The correct answer is 4. How much is 4 times 4? Enter your answer (-1 to exit): Wrong. Try once more. The correct answer is 16. 35 How much is 3 times 2? Enter your answer (-1 to exit: 6 Keep up the good work! How much is 7 times 4? Enter your answer (-1 to exit): Nice work! How much is 5 times 7? Enter your answer (-1 to exit): 35 Very good! How much is 7 times 5? Enter your answer (-1 to exit): Keep up the good work! How much is 2 times 7? Enter your answer 7-1'to exit): 14 Very good! How much is 7 times ? Enter your answer (-1 to exit): 163 Keep up the good work! How much is 1 times 97 Enter your answer (-1 to exit): 1-1 The questions generated by the system are: 3 * 2 = 6 Z * 4 = 28 5 * 7 = 35 Z * 5 = 35 2 * 7 = 7 X 9 = How much is 7 times 9? Enter your answer (-1 to exit): 63 Very good! How much is 2 times 2? Enter your answer (-1 to exit): 4 Keep up the good work! How much is 7 times 6? Enter your answer (-1 to exit): 40 Wrong. Try once more. The correct answer is 42. How much is 9 times $? Enter your answer 7-i' to exit): The questions generated by the system are: 4*4 = 16 Your answer was io, which is incorrect. 7 * 9 = 63 2 * 2 = 4 *6 = 42 Your answer was 40, which is incorrect. You got 6 questions and made 6 questions correct. Very good! You got 5 questions and made 2 questions correct. No. Please try again
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
