编写JSP页面,该页面提供一个表单,用户可以通过表单输入梯形的上底、下底和高的值,并交给本JSP页面,

2024-12-19 20:12:25
推荐回答(1个)
回答1:

public Trapezoidal{
public double top;
public double bottom;
public double high;
public double area;

public Trapezoidal(double top,double bottom,double high){
this.top=top;
this.bottom=bottom;
this.high=high;
}

public double getArea(){
return (this.top + this.botom)*this.high/2;
}

}