#include #include using namespace std; class DayTime { private: int hour, minute, second; public: DayTime() { hour = 0; minute = 0; second = 0; } DayTime(int h, int m, int s) { hour = h; minute = m; second = s; } int getHour() const { return hour; } int getMinute() const { return minute; } int getSecond() const { return second; } void DisplayTime() { cout << "HH: " << hour << endl << "MM: " << minute << endl << "SS: " << second << endl; } int asSeconds() const { return (3600 * hour + 60 * minute + second); } friend void operator <<(ostream& out, DayTime& h); friend void operator >>(istream& in, DayTime& h); friend void operator ++(DayTime &MainDayTime); friend void operator --(DayTime& MainDayTime2); }; void operator >> (istream& in, DayTime& h) { cout << "Input hours ( 0 , 24 ): "; in >> h.hour; cout << "Input minutes (0 , 60 ): "; in >> h.minute; cout << "Input seconds ( 0 ,60 ): "; in >> h.second; } void operator << (ostream& out, DayTime& h) { out << "HH: " << h.hour << endl << "MM: " << h.minute << endl << "SS: " << h.second << endl; } void operator ++ (DayTime& MainDayTime) { MainDayTime.second++; if (MainDayTime.second >= 60) { MainDayTime.second = 0; MainDayTime.minute++; } if (MainDayTime.minute >= 60) { MainDayTime.minute = 0; MainDayTime.hour++; } } void operator -- (DayTime& MainDayTime2) { MainDayTime2.minute--; if (MainDayTime2.minute < 0) { MainDayTime2.minute = 59; MainDayTime2.hour--; } } // Class 'Dollar' for the program 2 class Dollar { private: float currency, mktrate, offrate; public: Dollar() { currency = 100; mktrate = 9000; offrate = 7000; } float getDollar() { cout << endl<< "Currency: " << endl; return currency; } float getMarketSoums() { cout << "Markent currency: " << endl; return currency*mktrate; } float getofficialSoums() { cout << "Official currency:" << endl; return currency*offrate; } void setRates() { cout << "Enter current market rate: " << endl; cin >> mktrate; cout << "Enter current official rate: " << endl; cin >> offrate; } friend void operator<< (ostream &output, Dollar &p); }; void operator << (ostream &output, Dollar &p) { output << "Details of a dollar " << endl; output << "Currency is " << p.currency <> choice; switch (choice) { // for program 1 case 1: { system("cls"); int choice2; DayTime h1(10, 10, 10); DayTime h2; cin >> h2; showChoicesforMainMenu2(); do { cin >> choice2; switch (choice2) { case 1: cout << h2; cout << endl << endl; cout << "Enter your choice: "; break; case 2: cout << h2.asSeconds() <