-->
当前位置:首页 > 题库

PROGRAMMING:Declare the cuboid class, add a new member variable: weight, and add a function to calculate the surface area of the cuboid.

Luz5年前 (2021-05-10)题库393
Define a cuboid class, which has three attributes of length, width and height, and a function to calculate volume; To define a subclass to inherit the cuboid class, we need to add a new member variable: weight, and a function to calculate the surface area of the cuboid.
###Output format:
Please output the called construction parameters, add the display of member variable values, and calculate the surface area of the box function.
###Output example:
```out
The corresponding output is given here. For example:
The first constructor is called
The second constructor is called
The third constructor is called
Pass the object as a parameter, height = 3.0
three
two
Volume of newCuboid is3000.0
Weight of newCuboid is34.3
superficialarea of newCuboid is1300.0
```






answer:If there is no answer, please comment