Lab 5 - Bucket Volume
Due: Thursday, February 28, 2008

Introduction

This assignment asks you to model a cylindrical Bucket of water. Inside of this bucket may be at most one item that is either spherical cubical. Your model of this bucket should be Comparable and also throw an exception if the user attempts to place an item into the bucket which is too large to fit.

Specifics of the Bucket class

Hints

The Test Driver main()

The main() method of the Bucket class should serve as a non-interactive test driver. We will be grading this based upon its thoroughness -- and the ease with which a reader can interprete the output. Please make the output easy to understand, without knowledge of the code.

The InteractiveBucket main()

Please create an additional class, InteractiveBucket that creates two buckets and compares them -- except that, unlike the main() of the Bucket class, this main() should be interactive -- it should prompt the user for all values. This method need not be an exhaustive test. It need only alow the user to create two buckets, with or without items inside -- at the user's option -- and then compare them.

It should do something user-friendly in the event that an item will not fit into the bucket. In other words, it should handle the exception.