// file: pointProtected.cpp // PointProtected class definition; // represents an [x,y] coordinate pair as protected data members. #ifndef POINTPTOTECTED_H #define POINTPROTECTED_H class PointProtected { public: PointProtected( double = 0, double = 0 ); // default constructor void setX( double ); // set x in coordinate pair double getX() const; // return x from coordinate pair void setY( double ); // set y in coordinate pair double getY() const; // return y from coordinate pair void print() const; // output PointProtected object protected: double x; // x part of coordinate pair double y; // y part of coordinate pair }; // end class PointProtected #endif /*Adapted from Deitel & Deitel: C++ How to Program. Fourth edition. * Chapter 9 * Prentice Hall, 2003. */