00 /*
01  * point1.h
02  *
03  *      Author: Kurt Nørmark / Simonas Saltenis
04  */
05 
06 #ifndef POINT1_H_
07 #define POINT1_H_
08 
09 #include <iostream>
10 
11 class Point {
12 private:
13     double x {1.1},              // overridden by constructors
14            y {2.1},              // overridden by constructors
15            scaling_factor {2};   // common initialization accross constructors
16 
17 public:
18     // Here, we choose to define (not just declare) constructors inside of a class definition
19     Point(double x_coord, double y_coord): x{x_coord}, y{y_coord} {};
20     Point(): x{0.0}, y{0.0} {};
21 
22     double getx () const
23     {  return x * scaling_factor; };
24     double gety () const
25     { return x * scaling_factor;  };
26 
27     void move(double, double);
28     double distance_to(Point) const;
29 };
30 
31 std::ostream& operator<<(std::ostream&, const Point&);
32 
33 #endif /* POINT1_H_ */
34