Create a Java application or applet that uses threads to simulate a race. Here are the rules of the race. Each person in the race is given a 5 Gallon bucket that they must fill with water. Each person then must run 10 yards to a tap of water, fill their hands with water and return to the bucket and empty this water into the bucket. Unfortunately the movement from the tap to the bucket can cause water to spill out of the person’s hand, so this can take some time. There is one other problem as well. There are three people involved in the race but there is only one tap of water. So if a person arrives to fill their hands and the tap is taken they must wait for the tap to become available before they can fill their hands with water. Each thread will extend either a Jpanel (recommended) or JComponent object and have a paint method that will paint itself appropriately(paint a rectangle and fill it in to represent how much water is in the bucket). Each thread will have a method that puts itself to sleep for a randomly generated amount of time (this is travel time). Once the thread wakes up, you will attempt to fill your hands with water (if the tap is available). Once your threads hands are full you will use a random number generator to determine how much water has spilled out of your hands during travel time and adjust the amount of water in your hands. You will then empty this water into your bucket and continue doing this until the bucket is full. The winner is of course the first person to fill the bucket with water
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
Windows 2000 Professional, jdk 1.3.1
## Deadline information
Must be completed by 12\13\2002