Answer (sorry for loss of some indentation):
public class Circle {
// instance variable to store the radius of the circle
private double radius;
// constructors
// creates a circle with the specified radius
public Circle(double rad) {
radius = rad;
}
// creates a circle with the specified diameter
public Circle(int diameter) {
radius = diameter / 2.0;
}
// calculates and returns the area of the circle
// using the formula: area = PI * r^2
// where PI is the value of pi (3.1415…),
// r is the radius of the circle
public double area() {
return Math.PI * Math.pow(radius, 2);
}
// There may be other instance variables, constructors,
// and methods that are not shown.
}