登录
首页 » Java » JAVA

JAVA

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

  • stap_clutter
    联合空时自适应处理算法仿真之杂波谱仿真程序(Joint space-time adaptive processing algorithm simulation of the clutter spectrum simulation program)
    2021-02-26 01:19:37下载
    积分:1
  • toolbox_optim
    说明:  近端梯度算法,包含多种常见的近端梯度算法(Proximal gradient method matlab code)
    2020-04-16 22:19:04下载
    积分:1
  • 用c# asp.net 编写b/s模式的管理系统
    用c# asp.net 编写b/s模式的管理系统-asp.netc#
    2022-02-25 22:41:04下载
    积分:1
  • ieee_09_bus_with_pure_HVDC
    说明:  该模型为含HVDC的3机9节点系统,可应用于配电网,潮流计算等等等方面(HVDC EMBEDDED IN 3 GENERAOR AND 9 BUS SYSTEM)
    2019-10-21 18:22:44下载
    积分:1
  • 无人机避障
    说明:  模拟无人机避障的算法程序,模型比较简单,可以运行,需要借鉴学习的自取(Simulation UAV obstacle avoidance algorithm program, the model is relatively simple, can run, need to learn from the self)
    2020-11-09 16:11:38下载
    积分:1
  • STM32
    JY901 stm32f1程序 包括串口和IIC通信 亲测可用(JY901 stm32f1 include usart and IIC it can be used in different place)
    2018-09-04 09:59:27下载
    积分:1
  • VCS_labs
    说明:  EDA软件VCS学习中用到的实际例子,都已经通过调试验证(Practical examples used in the learning of EDA software VCS have been verified by experiments.)
    2019-04-29 11:45:52下载
    积分:1
  • stock_predict_with_LSTM-master
    说明:  基于python的LSTM做股票预测源代码(Based on Python LSTM stock forecast source code)
    2020-07-11 09:34:14下载
    积分:1
  • Headfile for AD5337 DAC use DAC_OUT(data value(0~254, DAC_A(0) or DAC_B(1), PD...
    Headfile for AD5337 DAC use DAC_OUT(data value(0~254, DAC_A(0) or DAC_B(1), PD Mode(0: normal, 1: PD mode), Clear mode (1: clear mode, 0: normal)
    2022-11-15 13:45:04下载
    积分:1
  • PronyToolbox
    prony matlab toolbox
    2020-11-02 09:39:53下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载