Question: void rectangleType::print ( ) const { cout Length = length ; Width = width; } rectangleType::rectangleType ( double 1 , double w

void rectangleType::print() const
{
cout "Length =" length
"; Width =" width;
}
rectangleType::rectangleType(double 1, double w)
{
setDimension(l, w);
}
rectangleType::rectangleType()
{
length =0;
width =0;
}derived from the class rectangleType in the class boxType
class rectangleType:
class boxType: public rectangleType
{
public:
void setDimension(double l, double w, double h);
//Function to set the length, width, and height
//of the box.
//Postcondition: length =1; width =w; height =h;
double getHeight() const;
//Function to return the height of the box.
//Postcondition: The value of height is returned.
double area() const;
//Function to return the surface area of the box.
//Postcondition: The surface area of the box is
// calculated and returned.
double volume() const;
//Function to return the volume of the box.
//Postcondition: The volume of the box is
??? calculated and returned.
void print() const;
//Function to output the length, width, and height of a box.
boxType();
//Default constructor
//Postcondition: length =0; width =0; height =0;
boxType(double 1, double w, double h);
//Constructor with parameters
//Postcondition: length =1; width =w; height =h;
private:
double height;
write the definition of the constructor of the class boxType.:rectangleType(l, w)
{
if (h>=0)
height = h;
else
height =0;
}A. The program is a continuation of the previous project. redefine a public member function
of a base class in the derived class, the corresponding function in the derived class must
have the same name, number, and types of parameters.-height: double
+setDimension(double, double, double): vold
+getHeight() const: double
+area() const: double
+volume() const: double
+print() const: yoid
+boxType()
+boxType(double, double, double)Define the member functions of the class rectangleType.{
if (l>=0)
length =1;
else
length =0;
if ( w >=0)
width = w;
else
width =0;
}
double rectangleType::getLength() const
{
return length;
}
double rectangleType::getWidth() const
{
return width;
}
double rectangleType::area() const
{
return length * width;
}
double rectangleType::perimeter() const
{
return 2*(length + width);
 void rectangleType::print() const { cout "Length =" length "; Width ="

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!