Answered step by step
Verified Expert Solution
Question
1 Approved Answer
give me full line to line code with execution Assignment Portion - hand in once completed (Geometry: n-sided mgular polygon) In an n-sided regular polygoe,
give me full line to line code with execution Assignment Portion - hand in once completed (Geometry: n-sided mgular polygon) In an n-sided regular polygoe, all sides have the same length and all angles have the same degroe (ie., the poly ron is both equilateral and equiangular). Design a class named Regul ar Pol ygon that contains: = A private int data field named n that defines the nmber of sides in the polygon with default value 3 . A private double data field named side that stcess the lingth of the side with default valoe 1. = A private double data ficld narned x that defiacs the x-cuordinate of the poly* gon's center with default value . a A private dovble data fiell named y that defines the y-coordiate of the poly. gon's center with default value 0 . = A no-arg conatructor that creates a regular polygon with defalt values. a A constructos that creafes a regular polygoe with the spocified aumber of sides and length of vide, centered at (0,0). = A conutructor that ereates a regular polygon with the specified number of sides, length of side, and x - and y-coocdinates. - The acceswor and mutator methods for all doti fields. - The method get perine ter (l) that returns the perinater of the polygon. - The method getArea () that renuns the area of the polygoa. The formula for compoting the area of a regular polyboe as Area=4tan(n)nx2 Draw the UML diagram for the class then implemeat ithe claws. Write a ics porgram that creater three Regularpolygon objocts, created wing the no-agg cee5.6,7,6). For ewh object. display its periencier and ara
give me full line to line code with execution
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