Question: Write an inherited class with name cubeplus using given cube class as base class with following conditions, (i) It will be possible to send parameters

 Write an inherited class with name cubeplus using given cube class

Write an inherited class with name cubeplus using given cube class as base class with following conditions,

(i) It will be possible to send parameters for initializing length, height and width of cube while defining an object using inherited class. Briefly, it must be possible to send parameters to constructor.

(ii) Define a member functions with name getsuar. This functions will just return surface area of cube.

(iii) Define another member function with name showvol which prints the volume of the cube on screen.

(iv) Override a unary ++ operator (for both prefix and postfix). This operator will increase height, widht and length of rectangle by 10%

Following definitions are given, #include #include struct dims {float wid, len, hei;}; class cube { private: float wil, h; protected: dims getdim () {dims d; d.wid=w; d.len=l; d.hei=h; return(d);} public: cube (float lg=5, float hg=5, float wd=5){WFwd;l=lg; h=hg; } void setdim (float lg, float hg, float wd) {1=lg; h=hg; w=wd; } float getvol () {return(1*h*w); } CUBOID height width length

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!