Looking for trustworthy answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Discover precise answers to your questions from a wide range of experts on our user-friendly Q&A platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

Exercise 2.10.6: Circle Area

Here is a Circle class.

Implement getArea and getCircumference by using methods from the Math class

————————————————————————————————————————————————————————

public class CircleTester

{

public static void main(String[] args)

{

Circle cup = new Circle(5);

System.out.println("Area of a circle with radius 5: " + cup.getArea());

System.out.println("Circumference of a circle with radius 5: " + cup.getCircumference());



Circle hat = new Circle(12);

System.out.println("nArea of a circle with radius 12: " + hat.getArea());

System.out.println("Circumference of a circle with radius 12: " + hat.getCircumference());



}

}







public class Circle

{

private double radius;



public Circle(double theRadius)

{

radius = theRadius;

}



// Implement getArea using

// Math.PI and

// Math.pow

// Area = pi * r^2

public double getArea()

{



}



// Implement getCircumference using

// Math.PI

// Circumference = 2 * PI * r

public double getCircumference()

{



}



}