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

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. +setRadius 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 Pi radius 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 circle's area, diameter, and circumference. Create another Circle 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) BIUS Paragcaph 100t 111 10 points A

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!