/* C++ Classes and Objects - Example Program */ #include #include #include class TIME { int hrs, mins, secs; char suf[4]; public: int totsecs; void gettime(int h, int m, int s) { hrs=h; mins=m; secs=s; totsecs=(hrs*60)+(mins*60)+secs; strcpy(suf, "Hrs"); } void puttime(void) { cout<<"Time is: "<12)?strcpy(t.suf,"pm"):strcpy(t.suf,"am"); t.hrs=((t.hrs>12)?(t.hrs-12):t.hrs); } cout<<"Time in am/pm is: "<>ch; cout<<"Converted times are:\n"; cout<<"Time 1: "; tm1.convert(tm1,ch); cout<<"Time 2: "; tm2.convert(tm2,ch); tm1.sum(tm1, tm2); prnvalues(tm2); getch(); }