Description
Consider the class Rectangle:
class Rectangle {
public:
Rectangle(double 1, double w);
double area() const;
double getLength() const;
double getWidth() const;
private:
double length;
double width;
};
(a) Derive a class Box from the class Rectangle. Provide only the interface for the class Box. The class Box has an additional private member variable height, and an additional public member function volume(). Include an accessor for the member variable height. Redefine the area() member function for the class Box. (6)
(b) Implement the member function area() for the class Box. The outside surface area of a box is 2(hW) + 2(hL) + 2(WL), where h represents the height of the box, and W and L the width and length of the box respectively. (3)
Mark Farwell –
Everything was completed on time and met my expectations.
Safir Adeni –
Very well written and finished ahead of schedule!