Question: C + + class Rectangle 1 public: Rectangle ( double 1 , double w ) ; double area ( ) const; double getLength ( )

C++
class Rectangle
1
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 volume () for the class Box. To find the volume of a box, multiply the length, width and height. (3)
 C++ class Rectangle 1 public: Rectangle (double 1, double w); double

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!