// definition of a point class and overloaded operators << and < #ifndef MY_POINT_H #define MY_POINT_H #include using namespace std; class point { public: point(int init_x = 0, int init_y = 0); // return a string representation of the point string to_string() const; // translate the coordinates by the given amount void translate(int dx, int dy); // return the distance from the origin of this point double distance_from_origin() const; // return the x coordinate of this point int get_x() const; // return the y coordinate of this point int get_y() const; // set the coordinates of this point void set_location(int newX, int newY); private: int x, y; }; // overloaded insertion operator for output ostream & operator<<(ostream & out, const point & p); // overloaded less-than operator for comparisons bool operator<(const point & lhs, const point & rhs); #endif