You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
739 B
37 lines
739 B
public class Circle implements Shape {
|
|
private double radius;
|
|
private String color;
|
|
|
|
public Circle(double radius, String color) {
|
|
this.radius = radius;
|
|
this.color = color;
|
|
}
|
|
|
|
@Override
|
|
public double calculateArea() {
|
|
return Math.PI * radius * radius;
|
|
}
|
|
|
|
@Override
|
|
public double calculatePerimeter() {
|
|
return 2 * Math.PI * radius;
|
|
}
|
|
|
|
@Override
|
|
public String getColor() {
|
|
return color;
|
|
}
|
|
|
|
@Override
|
|
public void setColor(String color) {
|
|
this.color = color;
|
|
}
|
|
|
|
public double getRadius() {
|
|
return radius;
|
|
}
|
|
|
|
public void setRadius(double radius) {
|
|
this.radius = radius;
|
|
}
|
|
} |