登录
首页 » Java » JAVA

JAVA

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

  • hengliuhengya
    电池恒流恒压电路应用仿真,能够实现电池电量控制(Battery constant current constant voltage circuit simulation, to achieve battery power control)
    2018-03-04 14:56:36下载
    积分:1
  • Statistical Learning Tutorial for Beginners
    说明:  方块图,CDF,相关性,协方差,假设检验。(Box plot, CDF, correlation, covariance, hypothesis testing.)
    2019-11-16 03:12:47下载
    积分:1
  • i2c 测试demo i2c-adapter
    说明:  i2c 测试demo,适用于i2c调试,可以适用示波器测量波形确认i2c是否通。(I2C test demo, suitable for I2C debugging, can be applied to oscilloscope measurement waveform to confirm whether I2C is passable.)
    2020-06-25 05:20:02下载
    积分:1
  • 一款VB财务表格控件
    一款VB财务表格控件-Financial forms a VB control
    2022-02-02 20:24:01下载
    积分:1
  • model
    matlab free code fo nural network
    2020-06-24 00:20:02下载
    积分:1
  • EMTP-models-program-guide
    EMtp 模块编程的指导书 很难的的atp/emtp中编程模块的指导书(EMtp module programming guide book Atp/emtp programming module in the guide book)
    2016-06-01 20:47:41下载
    积分:1
  • FDA
    画出频控阵和相控阵天线方向图,只要进行0和1输入,便可以选择相应的天线方向图(Drawing frequency diverse array and phased array antenna pattern)
    2018-01-13 19:19:36下载
    积分:1
  • Dis_huil
    实现离散灰色预测算法,该算法较灰色预测算法更为准确(Discrete grey prediction algorithm)
    2018-08-06 16:33:27下载
    积分:1
  • uniFiber
    说明:  采用三维hashin失效准则,判断复合材料渐进损伤(Judge progressive damage of composite material)
    2019-02-23 16:32:01下载
    积分:1
  • a dirty rectangular Demonstration Program, the online download, I hope useful fo...
    一个脏矩形演示程序,在网上下载的,希望对大家有用。-a dirty rectangular Demonstration Program, the online download, I hope useful for all.
    2022-11-23 04:25:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载