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

 in C++ Define a class type "Quadrilateral" that represents general 2-dimensional

in C++

Define a class type "Quadrilateral" that represents general 2-dimensional shapes having four sides (for examplectangle, square, trapezoid, etc). You can determine a four-sided shape by the coordinates of its four vertices. Use another class type Point to represent a 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 when 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!