登录
首页 » Java » JAVA

JAVA

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

  • MATLAB程序
    说明:  工程信号处理MATLAB分析程序,包含傅里叶变换、相关性分析、功率谱分析。(Engineering signal processing MATLAB analysis program, including Fourier transform, correlation analysis, power spectrum analysis.)
    2019-04-17 12:31:23下载
    积分:1
  • msc.zip
    用matlab进行msc变量标准化处理,(Using MATLAB for MSC processing)
    2017-09-29 20:31:20下载
    积分:1
  • prioritf-calpulator-calculator
    一个漂亮的带优先级的简单计算器 A nice simple calculator with priority(A beautiful take priority of simple calculator A nice simple calculator with priority)
    2017-04-06 15:06:19下载
    积分:1
  • evacuation-bottleneck-master
    说明:  解决人员疏散问题,利用社会力模型,很好的解决问题(Solve the problem of evacuation, use the social force model, solve problems well)
    2021-01-27 16:48:41下载
    积分:1
  • Lib source code of Machine study supporting Vector machine
    机器学习支持向量机的代码libsvm 2.36版-Lib source code of Machine study supporting Vector machine
    2023-03-12 21:40:04下载
    积分:1
  • nothignojakldfjasidof kqjwerqwe
    nothignojakldfjasidof kqjwerqwe
    2023-07-09 14:30:02下载
    积分:1
  • 缠论通达信动态链接库
    说明:  通达信画笔画段 中枢,走势类型 盘整 自动画笔画段和中枢(draw penciel and have the open sourse)
    2020-06-23 04:40:02下载
    积分:1
  • 极值理论matlab实现
    说明:  极值理论matlab的代码实现 非常实用 欢迎下载(Realization of extreme value theory by MATLAB)
    2020-12-07 16:39:22下载
    积分:1
  • 基于战舰版的IIC模式的射频RC522
    说明:  RC522 IIC 基于战舰版的IIC模式的射频RC522 利用IIC实现RC522芯片读写卡(RC522 IIC Radio Frequency RC522 Based on Warship Version IIC Mode Realization of RC522 Read-Write Card by IIC)
    2020-06-16 06:00:02下载
    积分:1
  • SPEI
    说明:  计算标准化降水蒸散指数SPEI 包含代码和使用说明(Calculation of standardized precipitation evapotranspiration index spei)
    2021-01-08 23:28:51下载
    积分:1
  • 696516资源总数
  • 106409会员总数
  • 8今日下载