Problem Description
编写1个球体类Sphere
(1)有2个私有数据成员,半径(radius)和常量π(PI)
(2)有1个计算体积的成员函数,还有其它必要的成员函数
完善以下程序
//你的代码写在这里
private:
double radius;
const double PI;
};
int main()
{
Sphere sphere(1.2, 3.14);
cout << sphere.Volume() << endl;
return 0;
}
Input Description
无
Output Description
输出球的体积
Sample Output
7.23456
#include <iostream>
using namespace std;
class Sphere