来自陈淼波的问题
【用C++编写定义一个圆柱体类Cylinder,包括:私有数据成员,其中包括:(1)radius(底圆半径,整数类型)(2)height(高度,整数类型)公有成员函数,其中包括:(1)构造函数:Cylinder(intr,inth】
用C++编写定义一个圆柱体类Cylinder,包括:私有数据成员,其中包括:
(1)radius(底圆半径,整数类型)
(2)height(高度,整数类型)
公有成员函数,其中包括:
(1)构造函数:Cylinder(intr,inth)
(2)表面积计算函数doublearea()
(3)体积计算函数doublevolume()
(4)打印表面积和体积信息的函数voidprint().
注:PI直接用3.14表示.
1回答
2020-11-20 03:18