【用C++编写定义一个圆柱体类Cylinder,包括:私有数-查字典问答网
分类选择

来自陈淼波的问题

  【用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-2003:18
我要回答
提示:回答问题需要登录哦!
牟世堂

  下面是我帮你编的.测试通过了#include#definePI3.14usingnamespacestd;classCylinder{private:intradius;x05intheight;x05public:x05Cylinder(intr,inth){x05radius=r;x05x05x05height=h;x05x0...

2020-11-20 03:19:16
大家都在问
最新问答