// CS2 Chung, // Review of Operator Overloading // #include #include class Point { private: double x; double y; public: Point() { cout << "Enter x and y for a point: "; cin >> x >> y; } Point(double init_x, double init_y) { x = init_x; y = init_y; } void display() { cout << "(" << x << ", "; cout << y << ")" << endl; } friend bool operator == (const Point& p1, const Point& p2); friend bool operator != (const Point& p1, const Point& p2); friend Point operator + (const Point& p1, const Point& p2); }; bool operator == (const Point& p1, const Point& p2) { } bool operator != (const Point& p1, const Point& p2) { } Point operator + (const Point& p1, const Point& p2) { } void main() { Point p1; Point p2; if(p1 == p2) cout << "Those points are equal." << endl; else cout << "Those points are NOT equal." << endl; if(p1 != p2) cout << "Those points are NOT equal." << endl; else cout << "Those points are equal." << endl; Point p3(p1+p2); p3.display(); }