Classes and Inheritance
Create the following classes use the tree diagram to determine the Inheritance for the classes put the full functions with the bodies in the .h files we will not be creating separate .cpp files for the classeshere are some specifications for the classes you will create Shape ( the Shape.h is completed already ) functions: double Area() , returns 0 double Volume() , returns 0 string ToString() , returns a string matching the example ---------------------------------------------------- Line non public data member type double , the length override ToString function void SetLength( double ) if the value passed in is less than 0 set length to 0 ------------------------------------------------------ Square override ToString function override Area function area is length * width but we dont have a width ( it is the same as length in a square ) ------------------------------------------------------ Cube override ToString function override Area function a cube has 6 sides so call the square area function and multiply it by 6 /* you MUST call the Area fuction of the Square */ override the Volume function depth * area of a side volume depth is the same as the length in a cube /* you MUST call the Area fuction of the Square */ ------------------------------------------------------ Rectangle non public data member type double , the width void SetWidth( double ) if the value passed in is less than 0 set width to 0 override ToString function override Area function area is length * width ------------------------------------------------------ Rectangular_Prism non public data member type double depth void SetDepth( double ) if the value passed in is less than 0 set depth to 0 override ToString function override Area function 2 * (length * width) + 2 * (length * depth) + 2 * (width * depth) override the Volume function volume = depth * area of rectangle ( use Rectangle::Area() ) ------------------------------------------------------ for your destructors just log the start and end you will need default and parameterized constructors none of your constructors shold allow data members to be set to values less than 0, Do not replicate logic to prevent this just like we did in the "constructor and destructor" lab Testing your classes if you create the classes in the order listed above the test mains should test the required classes DO NOT change anything in the main files. each of the mains tests the classes in the order above put the function bodies inside the class defenition, if you wish to break the function bodies into .cpp files you will need to alter the Makefile accordingly