Warning: You are not allowed to use malloc and free
Giving a bass-class Shape3D and 2 derived class : Sphere, Cube
You need to calculate the volume of each shape.
PS:
V of Sphere: V = 4/3 π r3
note : Remember to do some basic check, if the input is illegal (e.g. length < 0, pi < 0 .....) then the volume should be 0.
You don't need to consider the scenario like Cube -2, volume would be 0 instead of -8.
Hint1: Be careful the type of volume is double. 4/3=1 (int), so it should be 4.0/3.0
Hint2: You only need to implement the constructors.
There are only 2 shapes in this problem :
Ouput the total volume of all the shapes.