文件名称:Triangle-and-cylinder-class-package
-
所属分类:
- 标签属性:
- 上传时间:2013-03-16
-
文件大小:676byte
-
已下载: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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.