Question: option 1 closs 50 points Question #1 polygon) An n-sided regular polygon has n aides of the same length and that containa Geometry: a-sided regular
option 1 closs 50 points Question #1 polygon) An n-sided regular polygon has n aides of the same length and that containa Geometry: a-sided regular els angies have the sane degree (A.e.. the polygon io both equilateral and equiangular). Deaig a class named aute * A private data field nated that defineo the number ot sides in the polygon with det value 2 .A private double data field naned slde that stores the length ot the side with detault value 1. . A private le data field named that defines the x-coordinate of the center of the polygon with default value peivate dosble data field naned y that def ines the y-coordinate of the center ot the polygorn with default value . A no-arg conatructor that creates a regular polygon with default values. A cont ructor that ereatea a regular polygon vith the speeified nunber of sidea and the length . A conatotor that ereates a regular polygon with the specified number of sides, the length of . The method getperinterl that returns the perimeter of the polygon. The perimeter is the The method getArean that returns the area of the polygon. The formula tor computing the area side. and x-and y-coordinates The accessor and mutator methods for all data fields addition of the length of all the aides of the polygon. of a regular polygon is Area Use the Math.tan (double) nethod which also returns a 4tan( ) double. Question 82 25 points Create a seating class which will create two RegularPolygon objecta and it the two obiects are the isplay then display a nessage stating both objecta contain t the same Information ects are not the ect into the firat one. Do not assign the objects. You need to copy all the intormation from second object into the tlrst You will need to create two more methods in the Regularpolygon elass: equals checks if the information of two objects are the same copy -copies the information of one object into another Question 83 25 point Create a teating glass which will create 5 Regularpolygon objects. Set the side with a random number from 2 to 10 and set p with a randon number from 3 to8 Display the following for each polygon: . Perimeter . Area . Type of Polygon Type Polygon is based on the number of sides Sides Type Triangle Quadrilateral Pentagon Hexagon Heptagon Octagon option 1 closs 50 points Question #1 polygon) An n-sided regular polygon has n aides of the same length and that containa Geometry: a-sided regular els angies have the sane degree (A.e.. the polygon io both equilateral and equiangular). Deaig a class named aute * A private data field nated that defineo the number ot sides in the polygon with det value 2 .A private double data field naned slde that stores the length ot the side with detault value 1. . A private le data field named that defines the x-coordinate of the center of the polygon with default value peivate dosble data field naned y that def ines the y-coordinate of the center ot the polygorn with default value . A no-arg conatructor that creates a regular polygon with default values. A cont ructor that ereatea a regular polygon vith the speeified nunber of sidea and the length . A conatotor that ereates a regular polygon with the specified number of sides, the length of . The method getperinterl that returns the perimeter of the polygon. The perimeter is the The method getArean that returns the area of the polygon. The formula tor computing the area side. and x-and y-coordinates The accessor and mutator methods for all data fields addition of the length of all the aides of the polygon. of a regular polygon is Area Use the Math.tan (double) nethod which also returns a 4tan( ) double. Question 82 25 points Create a seating class which will create two RegularPolygon objecta and it the two obiects are the isplay then display a nessage stating both objecta contain t the same Information ects are not the ect into the firat one. Do not assign the objects. You need to copy all the intormation from second object into the tlrst You will need to create two more methods in the Regularpolygon elass: equals checks if the information of two objects are the same copy -copies the information of one object into another Question 83 25 point Create a teating glass which will create 5 Regularpolygon objects. Set the side with a random number from 2 to 10 and set p with a randon number from 3 to8 Display the following for each polygon: . Perimeter . Area . Type of Polygon Type Polygon is based on the number of sides Sides Type Triangle Quadrilateral Pentagon Hexagon Heptagon Octagon
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
