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

Write a Circle Classthat has the following fields: · Radius: adouble · PI: afina

ID: 3616397 • Letter: W

Question

Write a Circle Classthat has the following fields:

·         Radius: adouble

·         PI: afinal double initialized with the value 3.14159

The class should have the following methods:

·         Constructor. Acceptsthe radius of the circle as an argument.

·         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 calculate as

area = PI * radius * radius

·         getDiameter. Returnsthe diameter of the circle, which is calculated as

diameter = radius * 2

·         getCircumference. Returnsthe circumference of the of the circle, which is calculated as

circumference = 2 * PI * radius

Write a program that demonstrates the Circle class by asking theuser for the circle’s radius, creating a Circle object,and then reporting the circle’s area, diameter, andcircumference.

Explanation / Answer

x.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote