Question: Written in JAVA 1) Define a class for a circle that has fields for radius, area, and diameter. 2) Create methods in the class to

Written in JAVA

1) Define a class for a circle that has fields for radius, area, and diameter.

2) Create methods in the class to get and set data and to compute diameter, compute area, and get diameter and area.

3) Include a constructor where you can pass in the radius.

4) Write a test program that instantiates an object using the Circle class, sets the radius and displays the diameter and area using the console.

Hint: Area of Circle = PI * r2

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!