1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex4.2/Point.hh

36 lines
641 B
C++

//Point.hh
#ifndef POINT_HH
#define POINT_HH
class Point
{
public:
Point( double x = 0, double y = 0, double z = 0) { init( x, y, z ) ; }
// No need for Constructor or Destructor
int getX() const { return x ; }
void setX( double new_x ) { x = new_x ; }
int getY() const { return y ; }
void setY( double new_y ) { y = new_y ; }
int getZ() const { return z ; }
void setZ( double new_z ) { z = new_z ; }
void setPoint( double x, double y, double z ) {
setX(x) ;
setY(y) ;
setZ(z) ;
}
private:
void init( double x, double y, double z ) {
setPoint( x, y, z ) ;
}
double x, y, z = 0 ;
};
#endif