Question: MTRE 2610 - Engineering algorithms and visualization - Dr. Kevin McFall Homework-Inheritance 1. Create a base class Polygon from which several other classes of shapes



MTRE 2610 - Engineering algorithms and visualization - Dr. Kevin McFall Homework-Inheritance 1. Create a base class Polygon from which several other classes of shapes are derived according to the figure below. Constructors for each derived class should error check that the input argument points form a valid shape of the given type and offer an error message to the user if invalid. Polygon Triangle Parallelogram Right Triangle Equilateral Triangle Rectangle Triangle and parallelogram areas are abh and bh, respectively, where the height at point (xoo) is with the base passing through points() and (x2y2). The following header file is provided but the implementations of each member function must be completed. Additional member functions can be added as desired. Class functionality is then tested with the included main function. Extra credit is awarded if the data member array of points vertex is dynamically allocated. MTRE 2610 - Engineering algorithms and visualization - Dr. Kevin McFall Homework-Inheritance 1. Create a base class Polygon from which several other classes of shapes are derived according to the figure below. Constructors for each derived class should error check that the input argument points form a valid shape of the given type and offer an error message to the user if invalid. Polygon Triangle Parallelogram Right Triangle Equilateral Triangle Rectangle Triangle and parallelogram areas are abh and bh, respectively, where the height at point (xoo) is with the base passing through points() and (x2y2). The following header file is provided but the implementations of each member function must be completed. Additional member functions can be added as desired. Class functionality is then tested with the included main function. Extra credit is awarded if the data member array of points vertex is dynamically allocated
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
