文件名称:AreaAndLength
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 5kb
- 下载次数:
- 0次
- 提 供 者:
- 覃**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
类的封装
1. 实验目的
使用类来封装对象的属性和功能。
2. 实验要求
(1)编写一个简单的Java应用程序,该程序中定义3个类:Tangle、Lader和Circle,分别用来刻画“三角形”、“梯形”和“圆形”,具体要求如下:
Tangle类具有类型为double的三条边,以及周长、面积属性,具有计算并返回周长、面积以及三条边的功能,另外还要具有一个boolean型的属性,用来判断三个数能否构成一个三角形。
Lander类具有类型为double的上底、下底、高和面积属性,具有返回面积的功能。
Circle类具有类型为double的半径、周长和面积属性,具有返回周长、面积的功能。
(2)编写一个主类AreaAndLength测试上面的三个类。
(3)根据提供的程序模板,按模板要求,将代码替换为Java程序代码。-Class package
1. Purpose of the experiment
Use the class to encapsulate the object properties and functions.
2. Experimental requirements
(1) write a simple Java application, the program defined three categories: Tangle, Lader and the Circle, were used to characterize the "triangle", "ladder" and "round", the specific requirements are as follows:
Tangle class of the three edges of type double, and the perimeter, area properties, with calculation and returns the perimeter, area and features three sides of the other also has a boolean type attribute is used to determine whether the three numbers form a triangle.
Lander class type of the double bottom, under the bottom, height and area of property, has returned to the area function.
Circle class of type double the radius, circumference and area of property, has returned to the perimeter, area functions.
(2) preparation of a master class AreaAndLength test the above three categories.
(3) Accordi
1. 实验目的
使用类来封装对象的属性和功能。
2. 实验要求
(1)编写一个简单的Java应用程序,该程序中定义3个类:Tangle、Lader和Circle,分别用来刻画“三角形”、“梯形”和“圆形”,具体要求如下:
Tangle类具有类型为double的三条边,以及周长、面积属性,具有计算并返回周长、面积以及三条边的功能,另外还要具有一个boolean型的属性,用来判断三个数能否构成一个三角形。
Lander类具有类型为double的上底、下底、高和面积属性,具有返回面积的功能。
Circle类具有类型为double的半径、周长和面积属性,具有返回周长、面积的功能。
(2)编写一个主类AreaAndLength测试上面的三个类。
(3)根据提供的程序模板,按模板要求,将代码替换为Java程序代码。-Class package
1. Purpose of the experiment
Use the class to encapsulate the object properties and functions.
2. Experimental requirements
(1) write a simple Java application, the program defined three categories: Tangle, Lader and the Circle, were used to characterize the "triangle", "ladder" and "round", the specific requirements are as follows:
Tangle class of the three edges of type double, and the perimeter, area properties, with calculation and returns the perimeter, area and features three sides of the other also has a boolean type attribute is used to determine whether the three numbers form a triangle.
Lander class type of the double bottom, under the bottom, height and area of property, has returned to the area function.
Circle class of type double the radius, circumference and area of property, has returned to the perimeter, area functions.
(2) preparation of a master class AreaAndLength test the above three categories.
(3) Accordi
相关搜索: lader-area
(系统自动生成,下载前可以参看下载内容)
下载文件列表
AreaAndLength.doc
AreaAndLength.class
AreaAndLength.java
AreaAndLength.class
AreaAndLength.java