Example4_5

Contributor:游客136522539 Type:代码 Date time:2021-04-08 21:39:25 Favorite:0 Score:0
返回上页 Report
请选择举报理由:




Collection Modify the typo
package Example4_5;
public class Rect {
double width;
double height;
double getArea(){
double area = width*height;
return area;
}
package Example4_5;
public class Lader {
double above;
double bottom;
double height;
double getArea(){
return (above+bottom)*height/2;
}
}
package Example4_5;
public class Example4_5 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Rect ractangle = new Rect();
ractangle.width = 109.87;
ractangle.height = 25.18;
double area=ractangle.getArea();
System.out.println("矩形的面积:"+area);
Lader lader = new Lader();
lader.above = 10.798;
lader.bottom = 156.65;
lader.height = 18.12;
area = lader.getArea();
System.out.println("梯形的面积"+area);
}
}
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
Hot degree:
Difficulty:
quality:
Description: the system according to the heat, the difficulty, the quality of automatic certification, the certification of the article will be involved in typing!

This paper typing ranking TOP20

  • No data!

用户更多文章推荐