怎么用java计算梯形面积 Suppose that bases of a trapezoid are 8.9 and 12.1,and that the height is 16.Use Dr.Java's interactions pane to declare variables for the bases,height,and area,assign values,and compute the area.What code did you type
来源:学生作业帮助网 编辑:作业帮 时间:2024/05/28 07:27:54
怎么用java计算梯形面积
Suppose that bases of a trapezoid are 8.9 and 12.1,and that the height is 16.Use Dr.Java's interactions pane to declare variables for the bases,height,and area,assign values,and compute the area.
What code did you type to declare the four variables you needed?
What code did you type to assign values to the bases and the height?
What code did you type to compute the area?
What is the area of this trapezoid?
public class Test{
//梯形面积的方法
//a为梯形上底,b为梯形下底,h为梯形高,area为面积
public double area(double a,double b,double h){
double area;
//梯形面积公式:(上底+下底)*高/2
area=(a+b)*h/2;
return area;
}
//使用mian()方法实现
public static void main(String [] args){
Test t=new Test();
System.out.print("梯形面积为"+t.area(8.9,12.1,16));
}
}
JAVA计算梯形面积代码
用JAVA计算一个矩形的面积?
怎么计算梯形的面积
计算梯形面积怎么写?
怎么用java计算梯形面积 Suppose that bases of a trapezoid are 8.9 and 12.1,and that the height is 16.Use Dr.Java's interactions pane to declare variables for the bases,height,and area,assign values,and compute the area.What code did you type
怎么解释梯形面积计算公式?
三角形和梯形的面积怎么计算?
平行四边形,梯形的面积分别怎么计算?
梯形的面积是怎么计算的
梯形的周长和面积怎么计算
计算下面梯形的面积怎么做,
怎么写计算梯形面积的代码
梯形转换面积计算
计算梯形的面积?
梯形面积计算
等腰梯形的面积怎么用它的中位线计算啊如题
梯形的面积怎么计算,公式怎样表示
怎么计算火车皮上面梯形的面积.谢谢大家