Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Circle Square Triangle Based on the above hierarchy, please define classes as fo

ID: 3533701 • Letter: C

Question

Circle            Square             Triangle

Based on the above hierarchy, please define classes as following:

TwoDimensionalShape:

            Member functions: pure virtual function for GetArea

Circle:     Private data member: radius

            Member function: constructor, GetArea

Square:     Private data member: length

            Member function: constructor, GetArea

Triangle:   Private data members: base and height

            Member function: constructor, GetArea

Each TwoDimensionalShape should cotain a virtual function GetArea to calculate the area of the shape. Use the following main function to test your classes.

int main()

{

Circle c(10);

Square s(10);

Triangle t(10,5);

c.GetArea();                                  // will display

Explanation / Answer

//yes, it is not hard. Here you go and please rate:

http://ideone.com/HhYxSy

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote