Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions