Lab 14: Robot class.
In today's lab you must finish the simple calculator program and a robot program to show demonstration of your calcutor.
Download this zip file to get started.
-
Stage 1:
Add code to handleMouseReleased method in Board here so that when the "DoIt" button is clicked the sum of two operand is displayed in the result Square.
(main method for the caculator is in the class MouseAndKeys.
You may want to use Integer.toString(int i) to change a int to a String)
-
Stage 2:
Modify main class in RunRobot. It should press the "DoIt" button in the calculator window.
(The RunRobot class also contains a main method int it. Be careful which main method is used when you execute the program. You should run the calculator first, and then the robot.
You can assume that the calculator window at its original position. )
-
Stage 3:
(Advanced). Complete handleMouseReleased method in Board to make your calculator allow clicking on the numbers and changing them using keyboard input.
Submission:
1. You should work with a partner for a grade. Only one of you need to submit the program to Blackboard. But both of your names should be shown in the program you submit.
2. You should turn in to Blackboard by the end of the lab (8:50 for the 8-9 lab session, 9:50 for the 9-10 lab session), at which point the assignment for the lab is disabled.
Solution:
Stage 1 & 3.
Stage 2.