Question: Using Java create a Circle class that has: 1 double variable for radius A static variable PI which equals 3.14159 Gets and Sets statements for

Using Java

create a Circle class that has:

1 double variable for radius A static variable PI which equals 3.14159 Gets and Sets statements for the radius variable. A getArea() method that returns the Area of the Circle (formula is a = (PI * r^2), (use the Math.pow() method pg 62 in book). A getDiameter() method that returns the diameter of the circle (d=2r) A getCircumference() method that returns the circumference of the circle. Create a constructor for the Circle class that takes 1 argument. Create a No-Arg constructor for the Circle class. After creating the Circle Class, add a main method at the bottom that requests a number for input and returns information on the circle. Example Input and Output Please enter the radius of the circle 5.6 A circle with a radius of 5.60 will have an area of 98.52, a diameter of 11.20 and a circumference of 35.19.

The code:

import java.util.*; /* * Created: * Author: Olivia Nwanne * FileName: Circle.java */

public class Circle {

// enter code here

} // end Circle class"

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!