Question: public class Circle extends GeoShape { private double radius; public Circle ( String pColor, String pName, double pRadius ) { / / write your code

public class Circle extends GeoShape {
private double radius;
public Circle(String pColor, String pName, double pRadius)
{
// write your code here
// set the super class: 'GeoShape' color and name, do not assign values
// set the radius value without assignment statement, use method
}
private void setRadius(double pRad)
{
// write your code here
// assign the radius from pRad
}
public double getArea()
{
// write your code here
// return the area of a circle
// hint use 'Math.PI' to get pi value
}
public double getPerimeter()
{
// write your code here
// return the circumference of a circle
// hint use 'Math.PI' to get pi value
}
}

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!