Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MTRE 2610 - Engineering algorithms and visualization - Dr. Kevin McFall Homework - Inheritance 1. Create a base class Polygon from which several other classes
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 2bh and bh, respectively, where the height at point (x0.yo) is h = |(y2 yi ) X -(x3 x) y + x3y1 - y23|| (yz - y)2+(x3 17 ) with the base passing through points (x1.y) 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. Shapes.h header file with class prototypes: #include "Reintih" #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started