cylindr2.h

来自「经典vc教程的例子程序」· C头文件 代码 · 共 27 行

H
27
字号
// Fig. 9.10: cylindr2.h
// Definition of class Cylinder
#ifndef CYLINDR2_H
#define CYLINDR2_H

#include "circle2.h"

class Cylinder : public Circle {
   friend ostream &operator<<( ostream &, const Cylinder & );

public:
   // default constructor
   Cylinder( double h = 0.0, double r = 0.0,
             int x = 0, int y = 0 );

   void setHeight( double );   // set height
   double getHeight() const;   // return height
   double area() const;        // calculate and return area
   double volume() const;      // calculate and return volume

protected:
   double height;              // height of the Cylinder
};

#endif

⌨️ 快捷键说明

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