Home / Questions / PYTHON ONLY PLEASE (Geometry: n-sided regular polygon) An n-sided regular polygon’s sides all have t
PYTHON ONLY PLEASE
(Geometry: n-sided regular polygon)
An n-sided regular polygon’s sides all have the same length and all of its angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon that contains:
- A private int data field named n that defines the number of sides in the polygon.
- A private float data field named side that stores the length of the side.
- A private float data field named x that defines the x-coordinate of the center of the polygon with default value 0.
- A private float data field named y that defines the y-coordinate of the center of the polygon with default value 0.
- A constructor that creates a regular polygon with the specified n (default 3), side (default 1), x (default 0), and y (default 0).
- The accessor and mutator methods for all data fields.
- The method getPerimeter() that returns the perimeter of the polygon.
- The method getArea() that returns the area of the polygon. The formula for computing the area of a regular polygon is area = (n * s^2) / (4 * tan(PI / n)).
Draw the UML diagram for the class, and then implement the class.
Write a test program that creates three RegularPolygon objects, created using RegularPolygon(), RegularPolygon(6, 4) and RegularPolygon(10, 4, 5.6, 7.8). For each object, display its perimeter and area.
Apr 02 2020 View more View Less
A flu shot is a vaccine for several strains of influenza virus. This year, you get the shot and "the flu." What happened? (There are at least three explanations.)
Jun 07 2021At the beginning of last year Thomas purchased 200 shares of the Web.com Fund at an NAV of $26.00 and automatically reinvested all distributions. As a result of reinvesti...
Apr 02 2020Below is a multiple regression in which the dependent variable is market value of houses and the independent variables are the age of the house and square footage of the ...
Dec 07 2019Cost Classification and Cost BehaviorHeritage Company manufactures a beautiful bookcase that enjoys widespread popularity. The company has a backlog of orders that is lar...
Jun 28 2020Sell-Soft is the defendant in numerous lawsuits claiming unfair trade practices. Sell-Soft has strong incentives not to disclose these contingent liabilities. However, GA...
Apr 20 2020Fertility specialists may advise a couple who wish to conceive a child to use an alkaline (basic) douche immediately before intercourse. What might the reasoning behind t...
Jun 25 2021Eneliko Company installs home theater systems. The company’s most recent monthly contribution format income statement appears below:Required:1. Compute the company’...
Jul 01 2020-sin 2x e a). y =(x+5) - arccos 5x 6). y= B). y = Vr+4(x-3) (x+2) lim x.e-* a) y = 274_4x+2: 6) r? + 2x +1 T+21. Find derivatives of functions (in the task in - using ...
May 04 2021Marv Jackal, CPA, determines that a number of risks of material misstatement are pervasive to the overall Financial statements. How should Jackal respond to such pervasive risks?
Apr 24 2020