Question: Please use java in apache netbeans. In this lab, you are going to create a Circle class. This will have two data members: radius: Of

Please use java in apache netbeans. In this lab, you are going to create a Circle class. This will have two data members:

radius: Of double datatype

PI: Constant initialized with 3.14159

This class should have the following methods:

Default Constructor: It is no argument constructor which sets radius filed to 0.0

Constructor: Accepts radius of the circle as an argument.

setRadius: A mutator method for the radius field.

getRadius: An accessor method for the radius field.

calculateArea: Returns the area of the circle which is equal to (PI*radius*radius)

calculateDiameter: Returns the diameter of the circle which is equal to (2*radius)

calculateCircumference: Returns the circumference of the circle which is equal to (2*PI*radius)

Write a program which demonstrate the working of this class by creating 5 objects and then reporting the area, diameter, and the circumference of each of those 5 objects.

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 Databases Questions!