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::rectangleTypedouble double w
setDimensionl w;
rectangleType::rectangleType
length ;
width ;
derived from the class rectangleType in the class boxType
class rectangleType:
class boxType: public rectangleType
public:
void setDimensiondouble l double w double h;
Function to set the length, width, and height
of the box.
Postcondition: length ; width ; height ;
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 ; width ; height ;
boxTypedouble double w double h;
Constructor with parameters
Postcondition: length ; width ; height ;
private:
double height;
write the definition of the constructor of the class boxType.:rectangleTypel w
if h
height h;
else
height ;
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
setDimensiondouble double, double: vold
getHeight const: double
area const: double
volume const: double
print const: yoid
boxType
boxTypedouble double, doubleDefine the member functions of the class rectangleType.
if l
length ;
else
length ;
if w
width w;
else
width ;
double rectangleType::getLength const
return length;
double rectangleType::getWidth const
return width;
double rectangleType::area const
return length width;
double rectangleType::perimeter const
return length width;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
