Your objective is to write a program that enables the user to “program” a robot
to collect four “treasures.”
The screen should appear similar to the one shown below.
The robot, which is the small box, should start in the middle.
The user should “program” the robot to move by entering commands in the
textbox. The commands should be in
the following format: direction, distance.
For example, if the user wants the robot to move a distance of 150 in the
Northern direction, she should type: n 150.
Four “treasures” should be located around the screen.
When the robot lands on a treasure, the treasure should be turned to a
different color or disappear. Other
specific features of the program are discussed below.
Program Specifications:
____/10:
The screen should be similar to the one shown except that some commands
should be in a menu. The user
should be able to enter the commands in the text box.
____/10:
The program should not be case-sensitive. For example, both “N” and
“n” should be for
moving North.
____/10:
The location of the cursor and objects should be displayed when the user
moves the mouse.
____/10:
When the user clicks the Step command button, the robot should
complete one step (command).
____/10:
When the robot lands on a treasure, the color of the treasure should
change or the treasure should disappear to signify that it has been found.
____/10:
When the user has stepped through the entire set of commands, a message
box should appear, the robot should be moved back to its starting point, and
the color of the treasures should be reset.
____/10:
The user should be able to save a set of commands to a file of the users
choice. The user should also be
able to open and load a file of commands.
____/10:
The Randomize command button should randomize the locations of
the four treasures. You should
ensure that one treasure is located in each of the four quadrants (NE, NW, SE,
SW).
____/10:
The total distance that the robot travels should be displayed.
The distance should be updated every time that the user clicks the Step
button.
____/10:
The user should be able to save and open a file indicating the locations of the
treasures.