/******************************************************************************************** compass.h Jim Millard Practical 10 ********************************************************************************************/ #include <iostream> using namespace std; //class definition class compass { private: int degree; // 0-359 int minute; // 0-59 int second; // 0-59 static bool DecDeg; public: compass(const int d=0, const int m=0, const int s=0); //constructor with inits void print(ostream& out = cout) const; void addDegree(const int d); void addMinute(const int m); void addSecond(const int s); void addSame(const compass& C); const compass operator+(const compass& C); friend ostream& operator<<(ostream&, const compass&); static void setDD(bool DD = true) { DecDeg = DD; } static void unsetDD() { DecDeg = false; } const int& getDegree() const { return degree; } const int& getMinute() const { return minute; } const int& getSecond() const { return second; } };