Assignment 1
Modify, rewrite, subclass, or otherwise change the Tank class
and applet from Lab 3 in the following ways:
- The tanks are pictured as running `downhill' but the
Tank.add
method works as if they were running `uphill'.
Change the Tank.add
method to make sense here.
(Add or change any other methods if necessary or desired.)
- Write a
Tank.remove
method that removes an
indicated amount of water, again working in a way that
makes sense given that tanks are arranged downhill.
- Add code in the TankApplet to allow users to invoke
the
Tank.remove
method.
- Add a method and other support code in the TankApplet to allow
users to
deleteLast
-- delete the last
tank in the chain.
- Feel free to improve or change any of the methods controlling
graphical appearance. (Affects only up to 10% of score.)
Doug Lea
Last modified: Wed Sep 25 07:46:51 EDT 1996