Answer to Question #39188 in C++ for neha reddy

Question #39188
Create C++ classes for an inheritance hierarchy for shapes as shown in the diagram on next
page. The Shape has a pure virtual function SurfaceArea that needs to be implemented in its
derived classes.
class Shape
{
protected:
string name;
public:
Shape(string n) : name(n) {}
virtual float SurfaceArea() = 0;

You need to add appropriate data members to the derived classes and implement the
SurfaceArea function as Shape2D and Shape3D class. Write a main() to test Square, Circle,
Rectangle, Cylinder, and Pyramid objects.
1
Expert's answer
2014-03-04T10:21:58-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-39188.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS