c-resources/CPlusPlus20ForProgrammers-m.../examples/shapes/shapes.h

38 lines
604 B
C++

/*class GBaseShape {
public:
GBaseShape();
virtual void EvalVolume();
virtual void EvalSurface();
double GetVolume() const;
double GetVolume() const;
private:
double Volume, Surface;
bool IfVolumeCalculated;
bool IfSurfaceCalculated;
};
*/
class Cube {
public:
explicit Cube(double _L = 0, double _W = 0, double _H = 0);
// void SetAll();
void SetL(double _L);
// void SetB(double _B);
// void SetC(double _C);
double GetA() const;
private:
double L,W,H;
}
Cube::Cube(double _L = 0, double _W = 0, double _H = 0){
SetL(_L);
}