cylinder2.h

来自「用三个类来研究类的继承!类Point、Circle、Cylinder」· C头文件 代码 · 共 19 行

H
19
字号
//cylinder2.h
//类Cylinder的定义
#ifndef cylinder2_h
#define cylinder2_h

class Cylinder: public Circle{
	friend ostream &operator<< (ostream &output, const Cylinder &);
public:
	//默认构造函数
	Cylinder(float h=0.0, float r=0.0, float x=0.0, float y=0.0);
	void setHeight(float);	//设置高的值
	float getHeight() const;	//读取高的值
	float area() const;	//计算并返回圆柱体的表面积
	float volume() const;	//计算并返回圆柱体的体积
protected:
	float height;	//圆柱体的高度
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?