Question: Look carefully at Shape.h . Note how it declares protected fields volume and surfaceArea ( so all shapes have them ) , and it requires
Look carefully at Shape.h Note how it declares protected fields volume and surfaceArea so all shapes have them and it requires getVolume, getSurfaceArea, compareVolume, and compareSurfaceArea to be written in Shape.cpp But the other functions are virtual and These cannot be written in Shape.cpp and instead MUST be written in the subclasses.
CylinderCubeSpherecpp: In their header files, notice that in addition to the simple constructors and getterssetters all of the pure virtual functions are listed here, still with the keyword virtual, but without the All of these must be implemented per usual.
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
