C++ Programming Project: Box Class
Box Class
A box is a cube that can either be empty or have some content (string). I also may have a lid (boolean), and the lid may be open or shut (booolean).
Using the Cube class, create a Box class that "isa" Cube.
- A Box has length, width and height that are double. All dimensions must be positive.
- A Box might have a lid.
- A Box can be open or shut if it has a lid. If a Box doesn't have a lid then it can only be open.
- It has several constructors.
- It has getter and setter functions for each dimension and the contents, plus the lid and open.
- It has a method that returns the volume.
- A box is equal to another box if its volume is the same.
- A Box has all of the overloaded operators <, <=, !=, ==, <, >= that compre the volume.
- It has methods for toString that returns a string such as "2.5 X 3.0 X 8.5"
This web site, and all pages therein, are the sole property and responsibility of Zebra0.com.
It is not endorsed, sponsored, or provided by or on behalf of Montgomery College.