Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions