登录
首页 » Java » JAVA

JAVA

于 2021-05-07 发布
0 361
下载积分: 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 个回复

  • K-distribution-entropy
    利用k分布求熵,可以实现熵的K分布求解,很有用(calculate the entropy by use of the K distribution, which is of great importance)
    2015-11-13 09:43:39下载
    积分:1
  • 利用人工智能程序设计语言prolog编程实现的公式计算软件源代码。...
    利用人工智能程序设计语言prolog编程实现的公式计算软件源代码。-use artificial intelligence programming language prolog programming formula software source code.
    2023-04-26 08:25:03下载
    积分:1
  • AraxisMerge
    软件编写的过程中,经常需要跟之前备份的做比较,这就是一款很不错的比较软件(In the process of software writing, it is often necessary to compare with the previous backup. This is a very good comparison software)
    2019-06-04 15:20:31下载
    积分:1
  • cvxmod是一个Python
    CVXMOD is a Python-based tool for expressing and solving convex optimization problems.
    2022-05-22 04:28:17下载
    积分:1
  • Vector Control
    异步电机的矢量控制,是现代电机控制的核心基础,本模型基于simulink(Vector control of asynchronous motor is the core of modern motor control. This model is based on simulink.)
    2019-03-28 16:47:34下载
    积分:1
  • avrdudeprog33
    fdgafhgkjl; sgfhkgjkj dfj
    2019-03-17 03:11:53下载
    积分:1
  • Shopping
    说明:  购物车,软件测试课程成果,本人觉得有用并且质量不错(Shopping cart, software test course results, I think useful and good quality)
    2020-05-26 19:29:10下载
    积分:1
  • HDmap清洗
    说明:  对中海庭给的高精地图数据进行清洗,简易代码(data processing of HD map data)
    2019-07-11 09:53:52下载
    积分:1
  • orleans
    Orleans Actor模型编程框架 源码(Orleans Actor source code)
    2020-06-21 08:20:02下载
    积分:1
  • resource
    说明:  ENVI和IDL扩展应用,针对于多源数据的应用,处理遥感影像。(IDL and ENVI for remote sensing images process)
    2020-06-01 14:20:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载