Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started