This commit is contained in:
davoudn 2024-05-28 09:38:46 +03:30
commit cd0405b0c2
3 changed files with 89 additions and 0 deletions

Binary file not shown.

View File

@ -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;
}

View File

@ -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);
}