Question: The following program is supposed to assign a diameter to a circle and then print the circle's area. can you find all the bugs in

The following program is supposed to assign a diameter to a circle and then print the circle's area. can you find all the bugs in the program and fix them. please do not change any of the method headings

Public class PlayCircle

{

private double diameter;

public void setDiameter(double diameter)

{

Circle.diameter = diameter;

}

public void showArea()

{

double radius;

radius = circle.diameter / 2;

System.out.printIn("Area is " + (Math.PI * radius * radius));

}

public static void main(String[] args)

{

PlayCircle circle;

circle.setDiameter(4.0);

showArea();

}

} // end PlayCircle 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 Programming Questions!