Sample Finals
Sample 1: // Point.h: #ifndef POINT_H #define POINT_H class Point { private: double xcoord, ycoord; public: Point(); Point(double x, double y); bool operator==(const Point& p); double operator-(const Point& b); }; #endif // POINT_H Point.cpp: #ifndef POINT_H #define POINT_H class Point { private: double xcoord, ycoord; public: Point(); Point(double x, double y); bool operator==(const Point& p); double operator-(const Point& b); }; #endif // POINT_H main.cpp: #include <iostream> //Required for cout #include "Point.h" using namespace std; int main() { //Declare and initialize objects. Point p1; Point p2(1.5, -4.7); //Test operators if( p1 == p2) { cout << "p1 is equal to p2" << endl; } else { cout << "Distance between p1 and p2 is " << p1 - p2 << endl; } return 0; } Sample 2: //Decoding mes...