Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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: 3

blur-text-image

Ace Your Homework with AI

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

Get Started