文件名称:Triangle-and-cylinder-class-package
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Text]
- 上传时间:
- 2012-12-10
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- 李**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
(1)创建一个三角形类Triangle,包含的属性有三条边的长sideA,sideB,sideC,包含的方法有构造方法(两个,一个没有参数,一个给定三条边的长度),求面积方法area(),求周长方法getLength();
提示:设三角形的三边长为a,b,c,则它的面积为 ,其中S=(a+b+c)/2,开平方的方法为Math.sqrt()。
(2)创建一个圆柱体类YZT,包含的属性有底面半径radius和圆柱体的高heigth,包含的方法有构造方法(两个,一个没有参数,一个给定半径radius和圆柱体的高heigth),设置底面半径setRadius(),获取底面半径getRadius(),设置高setHeigth, 获取高getHeigth,求体积calTJ(),求表面积calBMJ();
(3)用上面的两个类分别定义对象,求三条边为分别为25,20,37.5和3.0,4.0,5.0的三角形的面积和周长,分别求底面半径为12.5,高为11的圆柱体和底面半径为20.5,高为30.5的圆柱体的体积和表面积。
-(1) create a Triangle kind of Triangle, including attribute has three side of the long sideA, sideB, sideC, including methods of structure method (two, a no parameters, a given three side length), quadrature method area (), and circumference method getLength ()
Tip: a triangle three side length for a, b, c, it is the area of, including S = (a+ b+ c)/2, square root method for Math. SQRT ().
(2) create a cylinder class YZT, including properties have bottom radius radius and the height of cylinder heigth, including methods of structure method (two, a no parameters, a given radius radius and the height of cylinder heigth), set up base radius setRadius (), get bottom radius getRadius (), set high setHeigth, get high getHeigth, cubage calTJ (), and surface area calBMJ ()
(3) using the above two classes were defined object, and three sides respectively,20,37.5 25 and 3.0, 4.0, 5.0 of the triangle area and perimeter, respectively for bottom radius is 12.5, height is 11 cylinder and unders
提示:设三角形的三边长为a,b,c,则它的面积为 ,其中S=(a+b+c)/2,开平方的方法为Math.sqrt()。
(2)创建一个圆柱体类YZT,包含的属性有底面半径radius和圆柱体的高heigth,包含的方法有构造方法(两个,一个没有参数,一个给定半径radius和圆柱体的高heigth),设置底面半径setRadius(),获取底面半径getRadius(),设置高setHeigth, 获取高getHeigth,求体积calTJ(),求表面积calBMJ();
(3)用上面的两个类分别定义对象,求三条边为分别为25,20,37.5和3.0,4.0,5.0的三角形的面积和周长,分别求底面半径为12.5,高为11的圆柱体和底面半径为20.5,高为30.5的圆柱体的体积和表面积。
-(1) create a Triangle kind of Triangle, including attribute has three side of the long sideA, sideB, sideC, including methods of structure method (two, a no parameters, a given three side length), quadrature method area (), and circumference method getLength ()
Tip: a triangle three side length for a, b, c, it is the area of, including S = (a+ b+ c)/2, square root method for Math. SQRT ().
(2) create a cylinder class YZT, including properties have bottom radius radius and the height of cylinder heigth, including methods of structure method (two, a no parameters, a given radius radius and the height of cylinder heigth), set up base radius setRadius (), get bottom radius getRadius (), set high setHeigth, get high getHeigth, cubage calTJ (), and surface area calBMJ ()
(3) using the above two classes were defined object, and three sides respectively,20,37.5 25 and 3.0, 4.0, 5.0 of the triangle area and perimeter, respectively for bottom radius is 12.5, height is 11 cylinder and unders
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Triangle and cylinder class package.txt