My arithmetic practice applet

I made a little Java project for practicing arithmetic. The computer asks the question, checks the answer, and keeps track of the score. It is a lot more interesting to program the practice than to do a whole page of it myself.

The calculation class keeps the two numbers, the computer’s answer, the user’s answer, and the score together. There are methods for addition, subtraction, and multiplication, with Swing dialog boxes supplying the interaction. It is a small exercise in getting input out of a string and comparing it to the result the program calculated.

I am still getting used to splitting a program into classes instead of putting every step in one long method. This is a nice size for that: the arithmetic is simple enough that I can spend more time thinking about where the state and methods should go.

CAI files