In this lab you will modify an existing GUI program (a game) to add a new feature and remove an arbitrary limitation. One of the best ways to learn about programming is to read and modify existing programs.
The program that you will modify is a game in which the user places disks of various sizes into a rectangular bin. The game continues until the user places a disk so that it either touches one of the edges of the bin, or overlaps an existing disk.
Your first task is to change the program so that it displays the number of disks that have been placed in the bin in the upper right hand corner of the screen. This number should be displayed in black text, and should be visible at all times For example, if the user places a disk in a part of the screen where current number of disks is displayed, it should not cover up the number.
Your second task is to remove the limit on the number of disks that may be placed by the user. As initially written, the game only allows the user to place a fixed number of disks, as specified by the constant MAX_DISKS. You should change the program so that any number of disks may be placed. However, you should do this
Start a web browser using the small Firefox button on the task bar at the bottom of the screen, or by typing
in a terminal window and hitting return. Go to the class web page, scroll down to the "Labs" section, and download the file lab3.zip into your home directory.firefox &
Start Eclipse by typing
in a terminal window and hitting return. Once it starts up, choose "File->Import->Existing Projects into Workspace" from the menu, click the "Next" button, click "Select archive file", select the file "lab3.zip" in your home directory, and click the "Finish" button. You will see a new project called "lab3" in the Package Explorer.eclipse &
To run the main method of the "BinPacking" class:
Once you have set up Eclipse to run BinPacking's main method, you can re-run it by clicking on the green toolbar button that looks like this:
When you are done, run the program and demonstrate to me that it can handle more than 20 disks in the bin at the same time.
Submit your completed project by entering the following commands in a terminal window (pressing return after each command):
cd cd eclipse-workspace submit102 lab3