Switch Statements & Two Button Applet (100 points)
Write an applet which will allow the user to select from an addtion or subtraction problem.
After the user makes a selection, instruct him to click a GO Button.
The GO Button must then active an addition or subtraction problem
with two random integers from 0 to 10 inclusively. Create a second button
called Check your result. This button must report to the user
whether his answer is correct or incorrect.
If the selection is an addition problem and the two random numbers are 8 and 2 then output 8 + 2 =
In a similar fashion, you must do likewise for the subtraction problem.
- Suppose the user answers incorrectly with 12, then output the following :
8 + 2 = 10.
- Suppose the user answers correctly with 10, then output the following :
Good! You are correct.
8 + 2 = 10
After the menu selection, your applet must use a switch statement as it's use
of decision control.
- Document your applet. Include your Name, Date, Project#, and a
description of the project.
- Input the data with the TextField class
- Allow all data input to be of type integer.
- Output your report with the TextArea class and setText method.
Sample Output for Project36