登录
首页 » Java » JAVA

JAVA

于 2021-05-07 发布
0 383
下载积分: 1 下载次数: 0

代码说明:

说明:  定义长方体类Cuboid,要求如下:(1)私有成员变量包括长length、宽width和高height;(2)构造方法包括一个公共的空构造方法,一个能够初始化所有成员变量的构造方法;(3)包括所有的setter和getter方法,其中setter方法要求对形参进行验证,例如长、宽和高都大于0;(4)功能方法包括计算表面积getArea()、计算体积getCubage()、判断是否正方体isCube()、输出该长方体的长宽高printCuboid()、绘制该长方体(给出提示信息即可)drawing()。 测试一要求如下:(1)利用空构造方法创建一个新的长方体对象cuboidA,然后利用setter方法设置长宽高分别为1.5、2.6和18.6,(2)调用printCuboid()方法输出cuboidA的基本信息,调用isCube()方法判断是否正方体;(3)调用方法drawing()模拟绘制该长方体。 测试二要求如下:(1)利用构造方法创建一个具有长宽高分别为2.5、6.8和8.0的长方体对象cuboidB,然后利用setLength()方法修改length为4.6;(2)调用getArea()方法计算表面积;(3)调用getCubage计算该长方体的体积。(The cuboid class cuboid is defined as follows: (1) the private member variables include length, width and H eight; (2) the construction method includes a public empty construction method, a construction method that can initialize all member variables; (3) all setter and getter methods are included, where the setter method requires to verify the parameters, such as length, width and height are greater than 0 (4) the function methods include calculating the surface area getarea (), calculating the volume getcube (), judging whether the cube is iscube (), outputting the length, width and height printcube (), drawing the box (just give the prompt information) drawing ().)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 优化设计
    利用ANSYS APDL 进行结构优化设计(Structural optimization design)
    2017-12-14 10:46:45下载
    积分:1
  • 一个非常好的迷宫游戏,用鼠标控制要走的路线,可以返回的....
    一个非常好的迷宫游戏,用鼠标控制要走的路线,可以返回的.-a very good arcade-style games, to go with the mouse to control the line can be returned.
    2022-03-23 17:34:02下载
    积分:1
  • Flash毛笔写字动画
    Flash毛笔写字动画,可扩展为钢笔、铅笔写字,圆珠笔写字动画,氏量配合图片实现,运用了Flash中的遮罩技术。
    2023-04-14 21:30:03下载
    积分:1
  • ABAQUS基础材料库—POLARIS_MAT_BASE_V1.0
    说明:  Abaqus基础材料数据库,方便abaqus模型的建立(Abaqus Basic Material Database)
    2021-02-04 12:19:58下载
    积分:1
  • fasdfsafafs
    Corum Online 源码 科隆服务端完整源码,可编译 -fasdfsafafs
    2022-03-25 04:39:32下载
    积分:1
  • 9682767
    C语言如何使用函数中的局部变量,仅供学习与参考(How to use C language function of the local variable, is only for study and reference)
    2017-08-19 14:31:44下载
    积分:1
  • CLX Diagram
    CLX Diagram You can always use conversion functions to register a conversion unit. There are times, however, when this requires you to create an unnecessarily large number of functions that all do essentially the same thing.
    2019-04-04 12:08:46下载
    积分:1
  • cthd39-40
    说明:  用于电力系统潮流计算,潮流方程的求解基本方法是迭代,包括牛顿-拉夫逊法,以及P-Q分解法(Power Flow Calculation for Power System)
    2019-06-02 15:00:04下载
    积分:1
  • 视觉检测的国外好论文,非常适合新手阅读。
    视觉检测的国外好论文,非常适合新手阅读。-Visual inspection of the foreign good papers, very suitable for novice to read.
    2022-08-22 09:13:30下载
    积分:1
  • 两个小例子
    说明:  利用cplex求解线性规划,利用大M转换0-1分段约束问题(Using CPLEX to solve linear programming and large M to transform 0-1 piecewise constraints)
    2019-02-06 21:57:58下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载