Question: 10 points QUESTION 1 Write a Circle class that has the following fields: -radius: a double Pl: a final double initialized with the value 3.14159

 10 points QUESTION 1 Write a Circle class that has the
following fields: -radius: a double Pl: a final double initialized with the

10 points QUESTION 1 Write a Circle class that has the following fields: -radius: a double Pl: a final double initialized with the value 3.14159 The class should have the following methods: + Constructor. Accepts the radius of the circle as an argument. + Constructor. A no-arg constructor that sets the radius field to 0.0. + Set Radius A mutator method for the radius field, + getRadius. An accessor method for the radius field. + getArea, Returns the area of the circle, which is calculated as area - Pradius. radius + getDiameter. Returns the diameter of the circle, which is calculated as diameter radius 2 + getcircumference. Returns the circumference of the circle, which is calculated as circumference 2. PL. radius getPl. Returns the value of PI + tostring. Return a string representing a circle to include radius, area and circumference labeled * equals. Returns true if radius of the circle passed to is the same as the object itself otherwise returns false Write a program to test the Circle class by asking the user for the circle's radius, creating a Circle object. and then reporting the drcle's area, diameter and circumference Create another circe and use equals to compare the 2 Circles and print the same if they are the same otherwise print not the same For the toolbar, press ALT+F10 (PC) or ALT-FN+F10(Mac) B. IUS Baragarh Ana 11 111 ili 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!