登录
首页 » Java » JAVA

JAVA

于 2021-05-07 发布
0 346
下载积分: 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编程解决实际问题的案例(About mathematical modeling knowledge, and the use of mathematical modeling algorithm, combined with MATLAB programming to solve practical problems)
    2017-08-02 15:48:54下载
    积分:1
  • PROSAIL_5B_MATLAB
    说明:  PROSAIL物理模型 模拟植被叶面积指数(PROSAIL Physical Model for Simulating Leaf Area Index of Vegetation)
    2019-03-30 22:14:17下载
    积分:1
  • 遗传算法多目标优化模板
    说明:  利用geatpy库是实现多目标优化, 基于改进NSGA-Ⅱ算法求解多目标优化问题的进化算法模板,传统NSGA-Ⅱ算法的帕累托最优解来只源于当代种群个体,这样难以高效地获取更多的帕累托最优解,同时难以把种群大小控制在合适的范围内,改进的NSGA2整体上沿用传统的NSGA-Ⅱ算法,不同的是,该算法通过维护一个全局帕累托最优集来实现帕累托前沿的搜索,故并不需要保证种群所有个体都是非支配的。(Using geatpy library to realize multi-objective optimization)
    2020-07-06 19:18:58下载
    积分:1
  • GVF-Snake
    说明:  1、包含GVF Snake和CGVF Snake的Matlab工具包 2、调用工具包内各函数完成GVF Snake和CGVF Snake的完整示例代码及其注释 3、附梯度矢量流英译汉注释文献(1. Matlab Toolkit with GVF Snake and CVF Snake 2. Call the functions in the toolkit to complete the sample code of GVF Snake and CVF Snake (annotated) 3. English-Chinese Translation of Annotated Documents with Gradient Vector Stream)
    2019-04-02 10:52:35下载
    积分:1
  • Eraser584Src
    说明:  Delphi Code Eraser Font
    2019-06-06 22:04:16下载
    积分:1
  • 温度检测系统课程设计资料
    51最小系统板pcb图,初学者简单学习,并且附有系统板说明,希望对大家能有帮助(51 Minimum System Board PCB chart, beginners simple learning, and with system board instructions, I hope you can help.)
    2019-05-13 21:36:09下载
    积分:1
  • 查看yuv文件的软件,非常使用.可以有几种格式查看文件
    查看yuv文件的软件,非常使用.可以有几种格式查看文件-View yuv document software, is the use of. There are several format can view the document
    2023-08-03 16:35:03下载
    积分:1
  • 资源
    通过采用有害气体传感器来检测室内环境的有害气体浓度,单片机读取有害传感器的数据与设定的限值进行比较,偌大于设定的安全限值,则认为有害气体泄漏,由单片机控制蜂鸣器进行报警(Toxic Gas Leakage Alarm Detection)
    2019-04-28 10:52:34下载
    积分:1
  • fit_ellipse
    用matlab编写的进行椭圆拟合的算法,用时要自己改变图片路径(Matlab prepared by the elliptical fitting algorithm, when used to change their own picture path)
    2017-06-23 12:18:07下载
    积分:1
  • ddispersion (2)
    用于非线性材料的二阶色散,即群速度色散,对非线性过程的相位匹配有一个很好的评估,带图像(it is useful to calculate two-order dispersion,)
    2017-11-14 09:36:27下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载