Question

C++ Regular Polygon Class

create a class called regularPolygon. it should have following private member variables that are integers, number of sides and length of sides. it will have thefollowing public member functions: a function to get the number of sides of the polygon, a function to get the length of the sides. it should have two separatefunctions, one to display the number of sides and one to display the length of the sides. it should have a function that determines and displays the area of thepolygon. this function is given below. enclose this class in a program that asks the user to provide the side and length input, that displays the number of sides, thelength of the sides, and the area of the polygon.

the program should be enclosed in a loop that allows the user to input as many create and display the properties of as many regular polygons as desired.

input validation: the number of sides must be greater than 2 and cannot be a negative umber.

comment with appropriate pre- and post-conditions

Solutions

Expert Solution
No answers


Submit Your Answer