Question: To make class polygon a pure virtual base class, choose the function or functions that must be overridden by all inherited classes. Adjust polygon.h to

To make class polygon a pure virtual base class, choose the function or functions that must be overridden by all inherited classes. Adjust polygon.h to become a pure virtual base class. Define polygon.cpp to implement the functions defined in polygon.h.

polygon.h is defined as follows:

class polygon{ private: int sides; public: polygon(int sides); //Constructor - default sides to 3 polygon(const polygon*); //Copy constructor void setSides(int sides); //setter for private attribute int getSides() const; //Getter for private attribute //Other functions double calcArea(); //calculates the area of a polygon double calcPerimeter(); //calculates the perimeter of a polygon void printDimensions(); //displays the dimensions of a polygon along with its area and perimeter }

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!