Assignment 5

Assigned Tuesday, November 5; Due Tuesday, November 12, 5pm

The Problem

(This is exercise 4.30 in our text book.) Write an applet, called MathTutor, that would help an elementary school student learn the multiplication tables. Use Math.random to produce 2 positive 1-digit integers. It then should display a question in the status bar such as:

How much is 6 times 7?

The student then types the answer into a TextField. Your program checks the student's answer. If it is correct, draw the string "Very good!" on the applet. Then, ask another multiplication question. If the answer is wrong, draw the string "No. Please try again." on the applet. Then, let the student try the same question again, repeatedly, until the student gets it right. A separate method should be used to generate each new question. This method should be called once when the applet begins execution, and each time the user answers the question correctly. All drawing on the applet should be preformed by the paint method.


Optional challenge

For those so inclined, here are 2 ways that you can enhance the function of your applet (you can choose to do either, both, or none):


Turn In Procedure