登录
首页 » Java » JAVA

JAVA

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

  • G制作的路径过渡动画幻灯片特效
    一款基于HTML5 SVG制作的路径过渡动画幻灯片特效(A special effect of path transition animation slide based on HTML5 SVG)
    2019-01-26 14:53:25下载
    积分:1
  • machine-learning-ex5
    吴恩达机器学习课程源码,第五个练习作业代码!(Wu nda machine learning course source code, fifth practice code!)
    2018-04-17 17:39:40下载
    积分: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
  • 扩散
    在有风和无风条件下对气体污染扩散的分析和模拟(Analysis and Simulation of Gas Pollution Diffusion under Wind and No Wind Conditions)
    2020-06-16 20:00:01下载
    积分:1
  • Start_button_hidden
    说明:  start button visible
    2019-02-20 21:07:54下载
    积分:1
  • python爬虫小程序
    说明:  用python编的爬虫小程序,希望大家喜欢,谢谢大家!(python internet reptile book)
    2020-06-22 20:20:01下载
    积分:1
  • 新建 ZIP 压缩文件
    说明:  红外导引伺服系统角跟踪回路仿真Simulink(Simulation of angle tracking loop of infrared guidance servo system)
    2020-06-24 07:26:55下载
    积分:1
  • OPTICS
    说明:  实现optics聚类算法,结合dbcasn进行对比(Optics clustering algorithm is implemented)
    2020-11-07 15:29:49下载
    积分:1
  • 用C语言实现的8位数码管电子钟源代码,很经典,很使用
    用C语言实现的8位数码管电子钟源代码,很经典,很使用-Using C language to achieve 8-bit digital tube钟源electronic code, is a classic, it is the use of
    2023-03-05 21:15:03下载
    积分:1
  • Hedoni-com
    享乐博弈用于通信中,大家可以看看,学习一下(Hedonic game is used in communication. You can see it and learn it.)
    2020-06-18 16:20:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载