Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

Do you strive to create a diverse workforce?

Answered: 1 week ago

Question

How would you describe your typical day at work?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago