shapes was added
This commit is contained in:
parent
db792e6fc1
commit
5e98b9d043
Binary file not shown.
|
@ -0,0 +1,52 @@
|
|||
|
||||
/*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);
|
||||
|
||||
const double& GetL();
|
||||
private:
|
||||
double L,W,H;
|
||||
};
|
||||
|
||||
|
||||
Cube::Cube(double _L , double _W , double _H ){
|
||||
SetL(_L);
|
||||
}
|
||||
|
||||
void Cube::SetL(double _L){
|
||||
L = _L;
|
||||
}
|
||||
|
||||
const double& Cube::GetL() {
|
||||
return L;
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
||||
Cube cube(5);
|
||||
cube.GetL()++;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
/*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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue