class Trangle{
private double a, b, c;//三个边
private double area;//面积
private double perimeter;//周长
public double getArea() {//返回面积
return area;
}
public double getPerimeter() {//返回周长
return a+b+c;
}
public void setA(double a) {//修改边a
this.a = a;
}
public void setB(double b) {//修改边b
this.b = b;
}
public void setC(double c) {////修改边c
this.c = c;
}
public static boolean isTrangle(double a, double b, double c){//判断三个数能否构成一个三角形
if(a <= 0 || b <=0 || c<=0){
return false;
}
return a + b > c && a + c > b && b + c > a;
}
}
class Lader{
private double a;//上底
private double b;//下底
private double h;//高
private double area;//面积
public double getArea() {//返回面积
return (a+b)*h/2;
}
}
class Circle{
private double r;//半径
private double perimeter;//周长
private double area;//面积
public double getArea() {//返回面积
return 3.14* r * r;
}
public double getPerimeter() {//返回周长
return 3.14*2*r;
}
}