Question: Python Design a class named RegularPolygon containing the following: 1 . An int data field named n defines the number of sides in the polygon.
Python
Design a class named RegularPolygon containing the following:
An int data field named n defines the number of sides in the polygon.
A float data field named side stores the length of the side.
A float data field named x defines the xcoordinate of the center of the polygon with a default value of
A float data field named y defines the ycoordinate of the center of the polygon with a default value of
A constructor that creates a regular polygon with the specified n default side default x default and y default
The accessor and mutator methods for all data fields.
The method getPerimeter returns the perimeter of the polygon.
The method getArea returns the area of the polygon.
Create three RegularPolygon objects
A using RegularPolygon
B using RegularPolygon
C using RegularPolygon
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
