Question: Define a class type Quadrilateral that represents general 2-dimensional shapes having four sides (for example: rectangle, square, trapezoid, etc). You can determine a four-sided shape

Define a class type "Quadrilateral" that represents general 2-dimensional shapes having four sides (for example: rectangle, square, trapezoid, etc). You can determine a four-sided shape by the coordinates of its four vertices. Use another class type Point to representa point on the shape (vertex for example). For the class type Point, add the necessary members as appropriate (coordinates data members, functions to read/write coordinates, constructors, etc). For the class Type Quadrilateral, include four vertices, in addition to the following function members: 1- constructors to initialize the shape 2- Accessor and Manipulator functions to read/write the vertex members 3- A function to print out the information about the four vertices of the shape After this, define a new class type Rectangle" that inherits from Quadrilateral. Make sure to add code to check for right angle whern initializing or updating information of a Rectangle object. Add two new methods to the new type to determine its area and perimeter, respectively Also, override the print function of the base type to also print the info about area and perimeter of the rectangle. Write a test program that instantiates a Rectangle object and prints its information to the screen Attach File
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
