Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is the link for part 1 post http://www.chegg.com/homework-help/questions-an

ID: 3648846 • Letter: H

Question

Here is the link for part 1 post
http://www.chegg.com/homework-help/questions-and-answers/5-parts-program-i-posting-separate-chance-earn-points-respond-post-garbage-code-thank-1-mo-q2848766


Part 2: Ellipse Class

Design a class Ellipse that extends class GeometricObject. An ellipse is characterized by the length a of its half-major axis and the length b of its half-minor axis.(a greater than or equal to b).

The area of an ellipse if given by pie*ab.

The perimeter of an ellipse is, amazingly, impossible to calculate precisely without using an infinite sum. Two approximations to the perimeter (P1 and P2) are given below. Your estimate of the perimeter should be the average of these two values.

and

(Those are brackets [] after the p, not "floor" symbols.)

Be sure to include the following methods in the Ellipse class:

Accessor ("get") and mutator ("set") methods for major and minor axes
perimeter()
area()

Explanation / Answer

Aside form the fact that the perimeter is impossible to calculate because the formulas that you seem to have tried to post aren't showing up, here's the code (NOTE: I commented in where you need to edit it for P1 and P2) public class Ellipse extends GeometricObject{ private double a;//half-major axis private double b;//half-minor axis public Ellipse(double a, double b) { super(); this.a = a; this.b = b; } /**get perimiter**/ public double getPerimiter() { double p1 = 0;//INSERT formula for P1 (not showing up in problem - ther's just blank space) double p2 = 0;//INSERT formula for P2 (not showing up in problem - ther's just blank space) return((p1+p2)/2.0); } /**Get area of ellipse**/ public double getArea() { return(Math.PI*a*b); } /** Return major axis */ public double getMajorAxis() { return a; } /** Set major axis */ public void setMajorAxis(double newA) { a = newA; } /** Return minor axis */ public double getMinorAxis() { return b; } /** Set minor axis */ public void setColor(double newB) { b = newB; } }