// class Point added by Hosung Leo Kim #include using namespace std; class Point { private: int x; int y; public: Point() {}; void setX( int val ) { x = val; } void setY( int val ) { y = val; } int getX() { return x; } int getY() { return y; } }; // class Point int main() { Point pt1, pt2, pt3, origin; pt1.setX(5); pt1.setY(7); cout << "Point pt1 is: (" << pt1.getX() << "," << pt1.getY() << ")" << endl; /* cout << "Point pt1 is in quadrant " << pt1.getQuadrant() << endl; pt2.setXY (-2, -4); pt3.setXY (-8, 9); origin.setXY (0, 0); cout << "Point pt2 is: "; pt2.printPoint(); cout << endl; cout << "Point pt2 is in quadrant " << pt2.getQuadrant() << endl; cout << "Point pt3 is: "; pt3.printPoint(); cout << endl; cout << "Point pt3 is in quadrant " << pt3.getQuadrant() << endl; cout << "Point origin is: "; origin.printPoint(); cout << endl; cout << "Point origin is in quadrant " << origin.getQuadrant() << endl; cout << "The distance between pt1 and pt2 is " << pt1.distanceFrom (pt2) << endl; cout << "The distance between pt2 and pt1 is " << pt2.distanceFrom (pt1) << endl; cout << "The distance between pt3 and the origin is " << pt3.distanceFrom (origin) << endl; cout << "The distance between the origin and pt3 is " << origin.distanceFrom (pt3) << endl; */ } /* /homes/home30/hkim16/107> a.out Point pt1 is: (5,7) /homes/home30/hkim16/107> */