Server IP : 172.16.15.8 / Your IP : 18.117.94.77 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/kmmowery/cs212/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
Script started on Mon 06 Apr 2009 02:25:56 PM EDT [kmmowery@zeus cs212]$ ./a.out List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: o You Choose : o List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: insert hello hello is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: computers computers is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: hello The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: s You Choose : s The list is sorted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: d You Choose : d The list is sorted to descending order. List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: hello The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: r You Choose : r After reversing the order of the list : computers hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: b You Choose : b The last word inserted was deleted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: kieara kieara is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: kieara List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: s You Choose : s The list is sorted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: kieara List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: q Done. [kmmowery@zeus cs212]$ exit Script done on Mon 06 Apr 2009 02:26:44 PM EDT t << "P Print the list.\n";[16;9Hcout << "B To delete the last word.\n";[K[17;9Hcout << "R Reverse the order.\n";[K[18;9Hcout << "S Sort to ascending order.\n";[19;9Hcout << "D To sort in the list.\n";[20;9Hcout << "Q Quit.\n";[21;9Hcout << "*************************************************\n\n";[22;9Hcout << "Your choice: ";[23;9H[K[24;1H}[K[25;1H [27;1H[K[28;1H [29;9H[K[30;9H[K[31;9H[K[32;9H[K[33;9H[K[34;9H[K[35;9H[K[36;9H[K[37;9H[K[20;34H[21;61H[22;33H[23;1H[22;33H[21;61H[20;34H[19;49H[18;53H[19;49H[19;48H[19;47H[19;46H[19;45H[19;44H[19;43H.\n"; [19;43H[19;42H.\n"; [19;42H[19;41H.\n"; [19;41H[19;40H.\n"; [19;40H[19;39H.\n"; [19;39H[19;38H.\n"; [19;38H[19;37H.\n"; [19;37H[19;36H.\n"; [19;36H[19;35H.\n"; [19;35H[19;34H.\n"; [19;34H[19;33H.\n"; [19;33H[19;32H.\n"; [19;32H[19;31H.\n"; [19;31H[19;30H.\n"; [19;30H[19;29H.\n"; [19;29H[19;28H.\n"; [19;28H[19;27H.\n"; [19;27H[19;26H.\n"; [19;26H[19;25H.\n"; [19;25Hs.\n";[19;26Ho.\n";[19;27Hr.\n";[19;28Ht.\n";[19;29H .\n";[19;30Ht.\n";[19;31Hh.\n";[19;32He.\n";[19;33H .\n";[19;34H[19;33H.\n"; [19;33H[19;32H.\n"; [19;32H[19;31H.\n"; [19;31H[19;30H.\n"; [19;30H[19;29H.\n"; [19;29H[19;28H.\n"; [19;28H[19;27H.\n"; [19;27H[19;26H.\n"; [19;26H[19;25H.\n"; [19;25HS.\n";[19;26Ho.\n";[19;27Hr.\n";[19;28Ht.\n";[19;29H .\n";[19;30Ht.\n";[19;31Ho.\n";[19;32H .\n";[19;33Hd.\n";[19;34He.\n";[19;35Hs.\n";[19;36Hc.\n";[19;37He.\n";[19;38Hn.\n";[19;39Hd.\n";[19;40Hi.\n";[19;41Hn.\n";[19;42Hg.\n";[19;43H .\n";[19;44Ho.\n";[19;45Hr.\n";[19;46Hd.\n";[19;47He.\n";[19;48Hr.\n";[19;49H[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mvector2.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;33H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 94 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico vector2.cpp./a.out[Kpico vector2.cpp[Kscript vector2 Script started, file is vector2 [kmmowery@zeus cs212]$ ,[K.[Kq bash: q: command not found [kmmowery@zeus cs212]$ quit bash: quit: command not found [kmmowery@zeus cs212]$ end bash: end: command not found [kmmowery@zeus cs212]$ exit exit Script done, file is vector2 [kmmowery@zeus cs212]$ script vector2pico vector2.cpp./a.out[K pico vector2.cppcd cs212[Kpico vector2.cppcd cs212[K pico vector2.cpp./a.out[Kpico vector2.cppscript vector2[K[Kg++ vector2.cpp [kmmowery@zeus cs212]$ script[Kt vector2 Script started, file is vector2 [kmmowery@zeus cs212]$ ./a.out List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: o You Choose : o List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: insert hello hello is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: computers computers is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: hello The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: s You Choose : s The list is sorted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: d You Choose : d The list is sorted to descending order. List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: hello The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: r You Choose : r After reversing the order of the list : computers hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: hello List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: b You Choose : b The last word inserted was deleted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: i You Choose : i Please insert a word: kieara kieara is insterted to the list List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: kieara List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: s You Choose : s The list is sorted List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: p You Choose : p The list is: computers The list is: kieara List Game ************************************************* I Insert an Integer. P Print the list. B To delete the last word. R Reverse the order. S Sort to ascending order. D Sort to descending order. Q Quit. ************************************************* Your choice: q Done. [kmmowery@zeus cs212]$ exit Script done, file is vector2 [kmmowery@zeus cs212]$ vi[K[Kpico vector2.cpp[K[K[K[K[K[K[K[K[K[K[Ktime2[K[K[K[K[K[K[K[K[K[Kcp time2.cpp [K[K[K[K[K[K[K[K[K[K[K[K[Kpico time2.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;66H[7m[ New file ][m[1;66H[7mFile: time2.cpp[m[3;1H[1;132H[7mModified[m[3;1H//[4;1H//[4;9H...[5;1H//[6;1H//[6;9HFile:[6;15H[6;17H[6;25H[38;1H[K[6;25Htime2.cpp[7;1H//[7;9HCompile:[7;25Hg++[7;29Htime1.cpp[7;39H-o[7;42Htime1.out[8;1H//[8;9HRun:[8;17H[8;25H./time.out[8;36H[9;1H//[9;9HGoal:[9;15H[9;17H[9;25HOOP[9;29Hinheritance[9;41H-[9;43HTime,[9;49HExtTime,[9;58H...[10;1H//[11;1H[12;1H#include[12;10H<iostream>[13;1H[14;1Husing[14;7Hnamespace[14;17Hstd;[15;1H[16;1Hclass[16;7HTime[17;1H{[17;3H[17;4H[17;5H[17;6H[17;7H[17;8H[17;9Hint[17;13Hhrs,[17;18Hmins,[17;24Hsecs;[18;1Hpublic:[19;1H[19;9H//[19;12Hconstructors[20;1H[20;2H[20;3H[20;4H[20;5H[20;6H[20;7H[20;8H[20;9HTime()[20;17H[20;25H//[20;28H0:0:0[21;1H[21;2H[21;3H[21;4H[21;5H[21;6H[21;7H[21;8H[21;9H{[21;11H[21;12H[21;13H[21;14H[21;15H[21;16H[21;17Hhrs[21;21H=[21;23H0;[21;26Hmins[21;31H=[21;33Hsecs[21;38H=[21;40H0;[21;43H[21;44H[21;45H[21;46H[21;47H[21;48H}[22;1H[22;9HTime(int[22;18Hh,[22;21Hint[22;25Hm,[22;28Hint[22;32Hs)[23;1H[23;9H{[23;17Hhrs[23;21H=[23;23Hh;[23;26Hmins[23;31H=[23;33Hm;[23;36Hsecs[23;41H=[23;43Hs;[23;49H}[24;1H[24;9Hvoid[24;14HSet(int[24;22Hh,[24;25Hint[24;29Hm,[24;32Hint[24;36Hs)[25;1H[25;9H{[25;17Hhrs[25;21H=[25;23Hh;[25;26Hmins[25;31H=[25;33Hm;[25;36Hsecs[25;41H=[25;43Hs;[25;46H[25;47H[25;48H[25;49H}[26;1H[26;9H//[26;12Hobservers[27;1H[27;9Hvoid[27;14HWrite()[27;22Hconst[27;33H//[27;36Hhh:mm:ss[28;1H[28;9H{[28;17Hcout[28;22H<<[28;25Hhrs[28;29H<<[28;32H":"[28;36H<<[28;39Hmins[28;44H<<[28;47H":"[28;51H<<[28;54Hsecs;[28;65H}[29;1H[29;9Hvoid[29;14HIncrement()[30;1H[30;9H{[30;17Hsecs[30;22H++;[30;33H}[31;1H[31;9Hbool[31;14HEqual([31;21HTime[31;26Hx)[31;29Hconst[32;1H[32;9H{[32;17Hif(hrs==x.hrs[32;31H&&[32;34Hmins==x.mins[32;47H&&[32;50Hsecs==x.secs)[33;1H[33;9H[33;17H[33;25Hreturn[33;32Htrue;[34;1H[34;9H[34;17Helse[34;22H[34;25Hreturn[34;32Hfalse;[35;1H[35;9H}[35;17H[36;1H};[37;1H[3;1H { hrs = 0; mins = secs = 0; }[4;1H Time(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; } [8;1H // observers[K[9;1H void Write() const // hh:mm:ss[K[10;1H { cout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[12;1H { secs ++; }[13;9Hbool Equal( Time x) const[14;1H { if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;25Hreturn true;[16;1H else return false;[17;1H }[K[18;1H};[K[19;9H[K[20;9H[K[21;9H[K[22;9H[K[23;9H[K[24;9H[K[25;9H[K[26;9H[K[27;9H[K[28;9H[K[29;9H[K[30;9H[K[31;9H[K[32;9H[K[33;25H[K[34;17H[K[35;9H [36;1H [20;1H//[20;4Hp.159[21;1Henum[21;6HZoneType[21;15H{EST,[21;21HCST,[21;26HMST,[21;31HPST,[21;36HEDT,[21;41HCDT,[21;46HMDT,[21;51HPDT};[22;1H[23;1H//[23;4Hdefine[23;11Ha[23;13Hnew[23;17Hclass[23;23H-[23;25Hsubclass[23;34HExtTime[23;42Hfrom[23;47Hsuperclass[23;58HTime[24;1Hclass[24;7HExtTime[24;15H:[24;17Hpublic[24;24HTime[25;1H{[25;9HZoneType[25;18Hzone;[25;25H//[25;28Hextra[25;34Hdata[25;39Hmember[26;1Hpublic:[27;1H[27;9HExtTime()[27;25H//[27;28H0:0:0[27;34HEST[28;1H[28;9H{[28;17Hzone[28;22H=[28;24HEST;[28;33H}[29;1H[29;9HExtTime(int[29;21Hh,[29;24Hint[29;28Hm,[29;31Hint[29;35Hs,[29;38HZoneType[29;47Hz)[30;1H[30;9H:[30;11HTime[30;16H(h,[30;20Hm,[30;23Hs)[31;1H[31;9H{[31;17Hzone[31;22H=[31;24Hz;[31;33H}[32;1H[32;9H//[32;12Hp.162[33;1H[33;9Hvoid[33;14HSet(int[33;22Hh,[33;25Hint[33;29Hm,[33;32Hint[33;36Hs,[33;39HZoneType[33;48Hz)[34;1H[34;9H{[34;17HTime[34;22H::[34;25HSet(h,[34;32Hm,[34;35Hs);[35;1H[35;9H[35;17Hzone[35;22H=[35;24Hz;[36;1H[36;9H}[37;1H[37;9Hvoid[37;14HWrite()[37;22Hconst[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[4;9H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[K[7;1H{ ZoneType zone; // extra data member[K[8;1Hpublic:[K[9;9HExtTime() // 0:0:0 EST[K[10;17Hzone = EST; }[K[11;9HExtTime(int h, int m, int s, ZoneType z)[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;9H// p.162[K[15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s)[17;9H zone = z;[18;1H }[19;9Hvoid Write() const[20;1H[K[21;1H[K[23;1H[K[24;1H[K[25;1H[K[26;1H[K[27;9H[K[28;9H[K[29;9H[K[30;9H[K[31;9H[K[32;9H[K[33;9H[K[34;9H[K[35;17H[K[36;9H [37;9H[K[20;1H[20;9H{[20;17HTime[20;22H::[20;25HWrite();[20;41H//[20;44Hhh:mm:ss[21;1H[21;9H[21;17Hstring[21;24HzoneString[][21;37H=[21;39H{"EST",[21;47H"CST",[21;54H"MST",[21;61H"PST",[21;68H[22;1H[22;9H[22;17H[22;25H[22;33H"EDT",[22;40H"CDT",[22;47H"MDT",[22;54H"PDT"};[22;62H[23;1H[23;9H[23;17Hcout[23;22H<<[23;25H"[23;27H"[23;29H<<[23;32HzoneString[zone];[24;1H[24;9H}[25;1H};[26;1H[27;1Hint[27;5Hmain()[28;1H{[29;1H[29;9H//[29;12HQ:[29;15HDef.[29;20Hobj[29;24Hof[29;27HExtTime[29;35Hx[29;37Hwith[29;42H13:30:00[29;51HEST?[30;1H[30;9HExtTime[30;17Hx(13,[30;23H30,[30;27H0,[30;30HEST);[31;1H[32;1H[32;9H//[32;12HQ:[32;15HOut[32;19H[33;1H[33;9Hx.Write();[34;1H[35;1H[36;1H[36;9Hcout[36;14H<<[36;17H"\n\nDone.\n\n";[37;1H[37;9Hreturn[37;16H0;[3;1H string zoneString[] = {"EST", "CST", "MST", "PST",[4;33H"EDT", "CDT", "MDT", "PDT"};[5;1H cout << " " << zoneString[zone];[K[6;1H }[K[7;1H};[K[8;1H[K[9;1Hint main()[K[10;1H{[K[11;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[12;9HExtTime x(13, 30, 0, EST);[13;9H[K[14;12HQ: Out[15;9Hx.Write();[K[16;9H[K[17;17H[K[18;9Hcout << "\n\nDone.\n\n";[19;9Hreturn 0;[K[20;9H[K[21;17H[K[22;33H[K[23;17H[K[24;9H [25;1H [27;1H[K[28;1H [29;9H[K[30;9H[K[32;9H[K[33;9H[K[36;9H[K[37;9H[K[20;1H}[21;1H[22;1H[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mtime2.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;31H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 74 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico time2.cppscript vector2pico time2.cpp[Kcp time2 > time3.[K cp: missing destination file Try `cp --help' for more information. [kmmowery@zeus cs212]$ cp time2 > time3pico time2.cpp[K [kmmowery@zeus cs212]$ pico time2.cpp[K3.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;66H[7m[ New file ][m[1;66H[7mFile: time3.cpp[m[3;1H[1;132H[7mModified[m[3;1H//[4;1H//[4;9H...[5;1H//[6;1H//[6;9HFile:[6;15H[6;17H[6;25Ht[38;1H[K[6;26Hime2.cpp[7;1H//[7;9HCompile:[7;25Hg++[7;29Htime1.cpp[7;39H-o[7;42Htime1.out[8;1H//[8;9HRun:[8;17H[8;25H./time.out[8;36H[9;1H//[9;9HGoal:[9;15H[9;17H[9;25HOOP[9;29Hinheritance[9;41H-[9;43HTime,[9;49HExtTime,[9;58H...[10;1H//[11;1H[12;1H#include[12;10H<iostream>[13;1H[14;1Husing[14;7Hnamespace[14;17Hstd;[15;1H[16;1Hclass[16;7HTime[17;1H{[17;3H[17;4H[17;5H[17;6H[17;7H[17;8H[17;9Hint[17;13Hhrs,[17;18Hmins,[17;24Hsecs;[18;1Hpublic:[19;1H[19;9H//[19;12Hconstructors[20;1H[20;2H[20;3H[20;4H[20;5H[20;6H[20;7H[20;8H[20;9HTime()[20;17H[20;25H//[20;28H0:0:0[21;1H[21;2H[21;3H[21;4H[21;5H[21;6H[21;7H[21;8H[21;9H{[21;11H[21;12H[21;13H[21;14H[21;15H[21;16H[21;17Hhrs[21;21H=[21;23H0;[21;26Hmins[21;31H=[21;33Hsecs[21;38H=[21;40H0;[21;43H[21;44H[21;45H[21;46H[21;47H[21;48H}[22;1H[22;9HTime(int[22;18Hh,[22;21Hint[22;25Hm,[22;28Hint[22;32Hs)[23;1H[23;9H{[23;17Hhrs[23;21H=[23;23Hh;[23;26Hmins[23;31H=[23;33Hm;[23;36Hsecs[23;41H=[23;43Hs;[23;49H}[24;1H[24;9Hvoid[24;14HSet(int[24;22Hh,[24;25Hint[24;29Hm,[24;32Hint[24;36Hs)[25;1H[25;9H{[25;17Hhrs[25;21H=[25;23Hh;[25;26Hmins[25;31H=[25;33Hm;[25;36Hsecs[25;41H=[25;43Hs;[25;46H[25;47H[25;48H[25;49H}[26;1H[26;9H//[26;12Hobservers[27;1H[27;9Hvoid[27;14HWrite()[27;22Hconst[27;33H//[27;36Hhh:mm:ss[28;1H[28;9H{[28;17Hcout[28;22H<<[28;25Hhrs[28;29H<<[28;32H":"[28;36H<<[28;39Hmins[28;44H<<[28;47H":"[28;51H<<[28;54Hsecs;[28;65H}[29;1H[29;9Hvoid[29;14HIncrement()[30;1H[30;9H{[30;17Hsecs[30;22H++;[30;33H}[31;1H[31;9Hbool[31;14HEqual([31;21HTime[31;26Hx)[31;29Hconst[32;1H[32;9H{[32;17Hif(hrs==x.hrs[32;31H&&[32;34Hmins==x.mins[32;47H&&[32;50Hsecs==x.secs)[33;1H[33;9H[33;17H[33;25Hreturn[33;32Htrue;[34;1H[34;9H[34;17Helse[34;22H[34;25Hreturn[34;32Hfalse;[35;1H[35;9H}[35;17H[36;1H};[37;1H[3;1H { hrs = 0; mins = secs = 0; }[4;1H Time(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; } [8;1H // observers[K[9;1H void Write() const // hh:mm:ss[K[10;1H { cout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[12;1H { secs ++; }[13;9Hbool Equal( Time x) const[14;1H { if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;25Hreturn true;[16;1H else return false;[17;1H }[K[18;1H};[K[19;9H[K[20;9H[K[21;9H[K[22;9H[K[23;9H[K[24;9H[K[25;9H[K[26;9H[K[27;9H[K[28;9H[K[29;9H[K[30;9H[K[31;9H[K[32;9H[K[33;25H[K[34;17H[K[35;9H [36;1H [20;1H//[20;4Hp.159[21;1Henum[21;6HZoneType[21;15H{EST,[21;21HCST,[21;26HMST,[21;31HPST,[21;36HEDT,[21;41HCDT,[21;46HMDT,[21;51HPDT};[22;1H[23;1H//[23;4Hdefine[23;11Ha[23;13Hnew[23;17Hclass[23;23H-[23;25Hsubclass[23;34HExtTime[23;42Hfrom[23;47Hsuperclass[23;58HTime[24;1Hclass[24;7HExtTime[24;15H:[24;17Hpublic[24;24HTime[25;1H{[25;9HZoneType[25;18Hzone;[25;25H//[25;28Hextra[25;34Hdata[25;39Hmember[26;1Hpublic:[27;1H[27;9HExtTime()[27;25H//[27;28H0:0:0[27;34HEST[28;1H[28;9H{[28;17Hzone[28;22H=[28;24HEST;[28;33H}[29;1H[29;9HExtTime(int[29;21Hh,[29;24Hint[29;28Hm,[29;31Hint[29;35Hs,[29;38HZoneType[29;47Hz)[30;1H[30;9H:[30;11HTime[30;16H(h,[30;20Hm,[30;23Hs)[31;1H[31;9H{[31;17Hzone[31;22H=[31;24Hz;[31;33H}[32;1H[32;9H//[32;12Hp.162[33;1H[33;9Hvoid[33;14HSet(int[33;22Hh,[33;25Hint[33;29Hm,[33;32Hint[33;36Hs,[33;39HZoneType[33;48Hz)[34;1H[34;9H{[34;17HTime[34;22H::[34;25HSet(h,[34;32Hm,[34;35Hs);[35;1H[35;9H[35;17Hzone[35;22H=[35;24Hz;[36;1H[36;9H}[37;1H[37;9Hvoid[37;14HWrite()[37;22Hconst[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[4;9H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[K[7;1H{ ZoneType zone; // extra data member[K[8;1Hpublic:[K[9;9HExtTime() // 0:0:0 EST[K[10;17Hzone = EST; }[K[11;9HExtTime(int h, int m, int s, ZoneType z)[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;9H// p.162[K[15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s)[17;9H zone = z;[18;1H }[19;9Hvoid Write() const[20;1H[K[21;1H[K[23;1H[K[24;1H[K[25;1H[K[26;1H[K[27;9H[K[28;9H[K[29;9H[K[30;9H[K[31;9H[K[32;9H[K[33;9H[K[34;9H[K[35;17H[K[36;9H [37;9H[K[20;1H[20;9H{[20;17HTime[20;22H::[20;25HWrite();[20;41H//[20;44Hhh:mm:ss[21;1H[21;9H[21;17Hstring[21;24HzoneString[][21;37H=[21;39H{"EST",[21;47H"CST",[21;54H"MST",[21;61H"PST",[21;68H[22;1H[22;9H[22;17H[22;25H[22;33H"EDT",[22;40H"CDT",[22;47H"MDT",[22;54H"PDT"};[22;62H[23;1H[23;9H[23;17Hcout[23;22H<<[23;25H"[23;27H"[23;29H<<[23;32HzoneString[zone];[24;1H[24;9H}[25;1H};[26;1H[27;1Hint[27;5Hmain()[28;1H{[29;1H[29;9H//[29;12HQ:[29;15HDef.[29;20Hobj[29;24Hof[29;27HExtTime[29;35Hx[29;37Hwith[29;42H13:30:00[29;51HEST?[30;1H[30;9HExtTime[30;17Hx(13,[30;23H30,[30;27H0,[30;30HEST);[31;1H[32;1H[32;9H//[32;12HQ:[32;15HOut[32;19H[33;1H[33;9Hx.Write();[34;1H[35;1H[36;1H[36;9Hcout[36;14H<<[36;17H"\n\nDone.\n\n";[37;1H[37;9Hreturn[37;16H0;[3;1H string zoneString[] = {"EST", "CST", "MST", "PST",[4;33H"EDT", "CDT", "MDT", "PDT"};[5;1H cout << " " << zoneString[zone];[K[6;1H }[K[7;1H};[K[8;1H[K[9;1Hint main()[K[10;1H{[K[11;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[12;9HExtTime x(13, 30, 0, EST);[13;9H[K[14;12HQ: Out[15;9Hx.Write();[K[16;9H[K[17;17H[K[18;9Hcout << "\n\nDone.\n\n";[19;9Hreturn 0;[K[20;9H[K[21;17H[K[22;33H[K[23;17H[K[24;9H [25;1H [27;1H[K[28;1H [29;9H[K[30;9H[K[32;9H[K[33;9H[K[36;9H[K[37;9H[K[20;1H}[21;1H[22;1H[21;1H[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[K[4;33H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[7;1H{ ZoneType zone; // extra data member[8;1Hpublic:[9;1H ExtTime() // 0:0:0 EST[10;1H { zone = EST; }[11;9HExtTime(int h, int m, int s, ZoneType z)[K[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;12Hp.162 [15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s);[17;17Hzone = z;[18;9H}[K[19;9Hvoid Write() const[20;1H { Time :: Write(); // hh:mm:ss[21;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[22;33H"EDT", "CDT", "MDT", "PDT"};[23;17Hcout << " " << zoneString[zone];[24;9H}[25;1H};[27;1Hint main()[28;1H{[29;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[30;9HExtTime x(13, 30, 0, EST);[32;9H// Q: Out[33;9Hx.Write();[36;9Hcout << "\n\nDone.\n\n";[37;9Hreturn 0;[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H { hrs = 0; mins = secs = 0; }[K[4;9HTime(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[K[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; }[8;1H // observers[9;9Hvoid Write() const // hh:mm:ss[10;17Hcout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[K[12;9H{ secs ++; }[13;9Hbool Equal( Time x) const[14;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;9H return true;[K[16;9H else return false[17;9H}[K[18;1H};[K[19;9H[K[20;1H// p.159[K[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[K[22;33H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[25;1H{ ZoneType zone; // extra data member[26;1Hpublic:[27;1H ExtTime() // 0:0:0 EST[28;1H { zone = EST; }[29;9HExtTime(int h, int m, int s, ZoneType z)[K[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;12Hp.162 [33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s);[35;17Hzone = z;[36;9H}[K[37;9Hvoid Write() const[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H//[K[4;1H// ...[K[5;1H//[K[6;1H// File: time2.cpp[K[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: OOP inheritance - Time, ExtTime, ...[10;1H//[K[11;9H[K[12;1H#include <iostream>[K[13;9H[K[14;1Husing namespace std;[K[15;25H[K[16;1Hclass Time[K[17;1H{ int hrs, mins, secs;[18;1Hpublic:[19;9H// constructors[20;1H Time() // 0:0:0[21;1H { hrs = 0; mins = secs = 0; }[K[22;9HTime(int h, int m, int s)[23;1H { hrs = h; mins = m; secs = s; }[K[24;1H void Set(int h, int m, int s)[25;1H { hrs = h; mins = m; secs = s; }[26;1H // observers[27;9Hvoid Write() const // hh:mm:ss[28;17Hcout << hrs << ":" << mins << ":" << secs; }[29;9Hvoid Increment()[K[30;9H{ secs ++; }[31;9Hbool Equal( Time x) const[32;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[33;9H return true;[K[34;9H else return false[35;9H}[K[36;1H};[K[37;9H[K[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H[4;1H[4;2H[4;3H[4;9H[4;10H[4;11H[4;12H[5;1H[5;2H[5;3H[6;1H[6;2H[6;3H[6;9H[6;10H[6;11H[6;12H[6;13H[6;14H[6;15H[6;17H[6;25H[6;26H[6;27H[6;28H[6;29H[6;30H[6;31H[6;30H[6;29H[6;30H[6;29H.cpp [6;29H3.cpp[6;30H[7;30H[8;30H[9;30H[10;3H[11;1H[12;20H[13;1H[14;21H[15;1H[16;11H[17;29H[18;8H[19;24H[20;30H[21;30H[22;30H[23;30H[24;30H[25;30H[26;21H[27;27H[28;30H[29;25H[30;25H[31;30H[32;30H[33;30H[34;30H[35;17H[36;3H[37;1H[3;1H { hrs = 0; mins = secs = 0; }[4;1H Time(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; } [8;1H // observers[K[9;1H void Write() const // hh:mm:ss[K[10;1H { cout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[12;1H { secs ++; }[13;9Hbool Equal( Time x) const[14;1H { if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;25Hreturn true;[16;1H else return false;[17;1H }[K[18;1H};[K[19;9H[K[20;1H// p.159[K[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[22;9H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[K[25;1H{ ZoneType zone; // extra data member[K[26;1Hpublic:[K[27;9HExtTime() // 0:0:0 EST[K[28;17Hzone = EST; }[K[29;9HExtTime(int h, int m, int s, ZoneType z)[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;9H// p.162[K[33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s)[35;9H zone = z;[36;1H }[37;9Hvoid Write() const[20;9H[21;30H[22;1H[23;30H[24;28H[25;30H[26;8H[27;30H[28;28H[29;30H[30;25H[31;26H[32;17H[33;30H[34;30H[35;26H[36;10H[37;27H[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[4;9H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[K[7;1H{ ZoneType zone; // extra data member[K[8;1Hpublic:[K[9;9HExtTime() // 0:0:0 EST[K[10;17Hzone = EST; }[K[11;9HExtTime(int h, int m, int s, ZoneType z)[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;9H// p.162[K[15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s)[17;9H zone = z;[18;1H }[19;9Hvoid Write() const[20;1H { Time :: Write(); // hh:mm:ss[21;1H string zoneString[] = {"EST", "CST", "MST", "PST",[22;33H"EDT", "CDT", "MDT", "PDT"};[23;1H cout << " " << zoneString[zone];[K[24;1H }[K[25;1H};[K[26;1H[K[27;1Hint main()[K[28;1H{[K[29;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[30;9HExtTime x(13, 30, 0, EST);[31;9H[K[32;12HQ: Out[33;9Hx.Write();[K[34;9H[K[35;17H[K[36;9Hcout << "\n\nDone.\n\n";[37;9Hreturn 0;[K[20;30H[21;30H[22;25H[23;30H[24;10H[25;3H[26;1H[27;11H[28;2H[29;30H[30;30H[31;1H[32;19H[33;19H[34;1H[35;1H[36;30H[37;18H[3;1H string zoneString[] = {"EST", "CST", "MST", "PST",[4;33H"EDT", "CDT", "MDT", "PDT"};[5;1H cout << " " << zoneString[zone];[K[6;1H }[K[7;1H};[K[8;1H[K[9;1Hint main()[K[10;1H{[K[11;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[12;9HExtTime x(13, 30, 0, EST);[13;9H[K[14;12HQ: Out[15;9Hx.Write();[K[16;9H[K[17;17H[K[18;9Hcout << "\n\nDone.\n\n";[19;9Hreturn 0;[K[20;1H}[K[21;17H[K[22;33H[K[23;17H[K[24;9H [25;1H [27;1H[K[28;1H [29;9H[K[30;9H[K[32;9H[K[33;9H[K[36;9H[K[37;9H[K[20;2H[21;1H[20;2H[19;18H[18;30H[17;1H[16;1H[15;19H[14;19H[13;1H[14;19H[13;1H[14;9H[K[15;9H// Q: Out [16;9Hx.Write();[18;9H[K[19;9Hcout << "\n\nDone.\n\n";[20;1H return 0;[21;1H}[14;1H\[14;9H[14;2H[14;1H [14;1H[15;9H[K[16;9H// Q: Out [17;9Hx.Write();[19;9H[K[20;9Hcout << "\n\nDone.\n\n";[21;1H return 0;[22;1H}[15;1H[15;9H// Q: Out[16;9Hx.Write();[17;9H[K[19;9Hcout << "\n\nDone.\n\n";[20;9Hreturn 0;[K[21;1H}[K[22;1H [14;1H[15;9H[K[16;9H// Q: Out [17;9Hx.Write();[19;9H[K[20;9Hcout << "\n\nDone.\n\n";[21;1H return 0;[22;1H}[15;1H[14;1H[14;9H//Q:[14;14Hchange[14;21Hx[14;23Htio[14;25H [14;25H[14;24H [14;24Ho[14;26H23:[14;28H [14;28H[14;27H [14;27H4:45:00;[16;9H[K[17;9H// Q: Out [18;9Hx.Write();[20;9H[K[21;9Hcout << "\n\nDone.\n\n";[22;1H return 0;[23;1H}[15;1H[15;9HExtTime[15;17Hx([15;18H [15;18H[15;17H [15;17H[15;16H[15;15H [15;15H[15;14H [15;14H[15;13H [15;13H[15;12H [15;12H[15;11H [15;11H[15;10H [15;10H[15;9H [15;9Hset.x[15;13H [15;13H[15;12H [15;12H[15;11H [15;11H[15;10H [15;10Hx[15;10H [15;10H[15;9H [15;9Hx.set([15;14H [15;14H[15;13H [15;13H[15;12H [15;12H[15;11H [15;11HSet(2[15;15H [15;15H()[15;16H [15;16H[15;15H [15;15H);[17;9H[K[18;9H// Q: Out [19;9Hx.Write();[21;9H[K[22;9Hcout << "\n\nDone.\n\n";[23;1H return 0;[24;1H}[16;1H[16;9H[15;9H[15;10H[15;11H[15;12H[15;13H[15;14H[15;15H1);[15;16H4);[15;17H:);[15;18H2);[15;19H4);[15;20H:);[15;21H0);[15;22H0);[15;23H[14;23H[14;24H[14;25H[14;26H[14;27H[14;26H4:45:00; [14;26H14:45:00;[14;27H[14;28H[15;25H[16;9H[17;1H[18;19H[19;19H[20;1H[19;19H[18;19H[17;1H[16;9H[15;25H[14;28H[15;25H[15;24H[15;23H[15;22H[15;21H[15;20H[15;21H[15;20H00); [15;20H,00);[15;21H[16;9H[17;1H[16;9H[15;21H[15;22H[15;21H[15;20H[15;19H[15;18H[15;17H24,00); [15;17H,24,00);[15;18H 24,00);[15;19H[15;20H[15;21H[15;20H,00); [15;20H[15;19H,00); [15;19H4,00);[15;20H5,00);[15;21H[15;22H[15;23H[15;24H[15;23H); [15;22H[15;23H );[15;24H,);[15;25H );[15;26H[15;25H); [15;25H[15;24H); [15;24H[15;23H); [15;23H[15;22H); [15;22H );[15;23H,);[15;24H );[15;25H[15;24H); [15;24H[15;23H); [15;23H0);[15;24H,);[15;25H );[15;26H[14;26H[14;27H[14;28H[14;29H[14;30H[14;31H[14;32H[14;33H[14;34H ;[14;35HE;[14;36HS;[14;37HT;[14;38H[14;39H[15;28H[15;27H[15;26H[15;25H[15;26H );[15;26HE );[15;27HS );[15;28HT );[15;29H, );[15;30H[15;29H ); [15;29H[14;29H[13;1H[12;29H[11;29H[12;29H[13;1H[14;29H[15;29H[14;29H[13;1H[14;29H[15;29H[16;9H[17;1H[16;9H[17;1H[18;9H[K[19;9H// Q: Out [20;9Hx.Write();[22;9H[K[23;9Hcout << "\n\nDone.\n\n";[24;1H return 0;[25;1H}[18;1H[17;1H[17;9H//Q:[17;14H[18;1H[19;14H[20;14H[20;15H[20;16H[20;17H[20;18H[20;19H[20;25H[20;33H//[20;36H14:45:00[19;19H[18;1H[17;14H[17;13H[17;12H[17;11H[17;10H[17;9H[K[18;9H// Q: Out[19;9Hx.Write(); // 14:45:00[20;9H[K[22;9Hcout << "\n\nDone.\n\n";[23;9Hreturn 0;[K[24;1H}[K[25;1H [17;1H[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mtime3.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;31H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 78 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico time3.cppcp time2 > time3pico time3.cpp[K[Kg bash: g: command not found [kmmowery@zeus cs212]$ g++ time3.cpp [kmmowery@zeus cs212]$ ./a.out 14:45:0 EST Done. [kmmowery@zeus cs212]$ ./a.outg++ time3.cpp[Kpico time3.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;64H[7m[ Reading file ][m[38;1H[K[38;63H[7m[ Read 78 lines ][m[1;66H[7mFile: time3.cpp[m[3;1H//[4;1H// ...[5;1H//[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: OOP inheritance - Time, ExtTime, ...[10;1H//[12;1H#include <iostream>[14;1Husing namespace std;[16;1Hclass Time[17;1H{ int hrs, mins, secs;[18;1Hpublic:[19;9H// constructors[20;9HTime() // 0:0:0[21;9H{ hrs = 0; mins = secs = 0; }[22;9HTime(int h, int m, int s)[23;9H{ hrs = h; mins = m; secs = s; }[24;9Hvoid Set(int h, int m, int s)[25;9H{ hrs = h; mins = m; secs = s; }[26;9H// observers[27;9Hvoid Write() const // hh:mm:ss[28;9H{ cout << hrs << ":" << mins << ":" << secs; }[29;9Hvoid Increment()[30;9H{ secs ++; }[31;9Hbool Equal( Time x) const[32;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[33;25Hreturn true;[34;17Helse return false;[35;9H}[36;1H};[3;1H[4;1H[5;1H[6;1H[7;1H[8;1H[9;1H[10;1H[11;1H[12;1H[13;1H[14;1H[15;1H[16;1H[17;1H[18;1H[19;1H[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[38;1H[K[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1H { hrs = 0; mins = secs = 0; }[4;1H Time(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; } [8;1H // observers[K[9;1H void Write() const // hh:mm:ss[K[10;1H { cout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[12;1H { secs ++; }[13;9Hbool Equal( Time x) const[14;1H { if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;25Hreturn true;[16;1H else return false;[17;1H }[K[18;1H};[K[19;9H[K[20;1H// p.159[K[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[22;9H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[K[25;1H{ ZoneType zone; // extra data member[K[26;1Hpublic:[K[27;9HExtTime() // 0:0:0 EST[K[28;17Hzone = EST; }[K[29;9HExtTime(int h, int m, int s, ZoneType z)[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;9H// p.162[K[33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s)[35;9H zone = z;[36;1H }[37;9Hvoid Write() const[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[4;9H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[K[7;1H{ ZoneType zone; // extra data member[K[8;1Hpublic:[K[9;9HExtTime() // 0:0:0 EST[K[10;17Hzone = EST; }[K[11;9HExtTime(int h, int m, int s, ZoneType z)[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;9H// p.162[K[15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s)[17;9H zone = z;[18;1H }[19;9Hvoid Write() const[20;1H { Time :: Write(); // hh:mm:ss[21;1H string zoneString[] = {"EST", "CST", "MST", "PST",[22;33H"EDT", "CDT", "MDT", "PDT"};[23;1H cout << " " << zoneString[zone];[K[24;1H }[K[25;1H};[K[26;1H[K[27;1Hint main()[K[28;1H{[K[29;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[30;9HExtTime x(13, 30, 0, EST);[31;9H[K[32;11HQ: change x to 14:45:00 EST;[33;9Hx.Set(14, 45, 0, EST );[K[34;9H[K[35;17H[K[36;9H// Q: Out[37;9Hx.Write(); // 14:45:00[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[29;55H[30;35H[31;1H[32;39H[33;32H[33;31H[33;30H[33;29H[33;28H[33;27H[33;26H[33;25H[33;24H[1;132H[7mModified[m[33;24H0, EST );[33;25H[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mtime3.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;31H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 78 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico time3.cpp./a.out[Kg++ time3.cpp [kmmowery@zeus cs212]$ g++ time3.cpppico time3.cpp./a.out[K 14:45:0 EST Done. [kmmowery@zeus cs212]$ ./a.outg++ time3.cpppico time3.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;64H[7m[ Reading file ][m[38;1H[K[38;63H[7m[ Read 78 lines ][m[1;66H[7mFile: time3.cpp[m[3;1H//[4;1H// ...[5;1H//[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: OOP inheritance - Time, ExtTime, ...[10;1H//[12;1H#include <iostream>[14;1Husing namespace std;[16;1Hclass Time[17;1H{ int hrs, mins, secs;[18;1Hpublic:[19;9H// constructors[20;9HTime() // 0:0:0[21;9H{ hrs = 0; mins = secs = 0; }[22;9HTime(int h, int m, int s)[23;9H{ hrs = h; mins = m; secs = s; }[24;9Hvoid Set(int h, int m, int s)[25;9H{ hrs = h; mins = m; secs = s; }[26;9H// observers[27;9Hvoid Write() const // hh:mm:ss[28;9H{ cout << hrs << ":" << mins << ":" << secs; }[29;9Hvoid Increment()[30;9H{ secs ++; }[31;9Hbool Equal( Time x) const[32;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[33;25Hreturn true;[34;17Helse return false;[35;9H}[36;1H};[3;1H[4;1H[5;1H[6;1H[7;1H[8;1H[9;1H[10;1H[11;1H[12;1H[13;1H[14;1H[15;1H[16;1H[17;1H[18;1H[19;1H[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[38;1H[K[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1H { hrs = 0; mins = secs = 0; }[4;1H Time(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; } [8;1H // observers[K[9;1H void Write() const // hh:mm:ss[K[10;1H { cout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[12;1H { secs ++; }[13;9Hbool Equal( Time x) const[14;1H { if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;25Hreturn true;[16;1H else return false;[17;1H }[K[18;1H};[K[19;9H[K[20;1H// p.159[K[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[22;9H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[K[25;1H{ ZoneType zone; // extra data member[K[26;1Hpublic:[K[27;9HExtTime() // 0:0:0 EST[K[28;17Hzone = EST; }[K[29;9HExtTime(int h, int m, int s, ZoneType z)[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;9H// p.162[K[33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s)[35;9H zone = z;[36;1H }[37;9Hvoid Write() const[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[4;9H[K[5;1H// define a new class - subclass ExtTime from superclass Time[6;1Hclass ExtTime : public Time[K[7;1H{ ZoneType zone; // extra data member[K[8;1Hpublic:[K[9;9HExtTime() // 0:0:0 EST[K[10;17Hzone = EST; }[K[11;9HExtTime(int h, int m, int s, ZoneType z)[12;9H: Time (h, m, s)[K[13;9H{ zone = z; }[14;9H// p.162[K[15;9Hvoid Set(int h, int m, int s, ZoneType z)[16;9H{ Time :: Set(h, m, s)[17;9H zone = z;[18;1H }[19;9Hvoid Write() const[20;1H { Time :: Write(); // hh:mm:ss[21;1H string zoneString[] = {"EST", "CST", "MST", "PST",[22;33H"EDT", "CDT", "MDT", "PDT"};[23;1H cout << " " << zoneString[zone];[K[24;1H }[K[25;1H};[K[26;1H[K[27;1Hint main()[K[28;1H{[K[29;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[30;9HExtTime x(13, 30, 0, EST);[31;9H[K[32;11HQ: change x to 14:45:00 EST;[33;9Hx.Set(14, 45, 00, EST );[K[34;9H[K[35;17H[K[36;9H// Q: Out[37;9Hx.Write(); // 14:45:00[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[35;1H[34;9H[34;1H[33;33H[33;32H[33;31H[33;30H[33;29H[33;28H[33;27H[33;26H[33;25H[33;24H[33;23H[33;24H[1;132H[7mModified[m[33;24H, EST ); [33;23H[32;23H[31;1H[30;23H[29;23H[28;2H[27;11H[26;1H[25;3H[24;10H[23;23H[22;17H[21;23H[20;23H[19;23H[18;10H[17;23H[16;23H[15;23H[14;17H[13;23H[12;23H[11;23H[10;23H[9;18H[8;8H[7;23H[6;23H[5;23H[4;1H[3;23H[3;1H { hrs = 0; mins = secs = 0; }[K[4;9HTime(int h, int m, int s)[5;1H { hrs = h; mins = m; secs = s; }[K[6;1H void Set(int h, int m, int s)[7;1H { hrs = h; mins = m; secs = s; }[8;1H // observers[9;9Hvoid Write() const // hh:mm:ss[10;17Hcout << hrs << ":" << mins << ":" << secs; }[11;9Hvoid Increment()[K[12;9H{ secs ++; }[13;9Hbool Equal( Time x) const[14;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[15;9H return true;[K[16;9H else return false[17;9H}[K[18;1H};[K[19;9H[K[20;1H// p.159[K[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[K[22;33H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[25;1H{ ZoneType zone; // extra data member[26;1Hpublic:[27;1H ExtTime() // 0:0:0 EST[28;1H { zone = EST; }[29;9HExtTime(int h, int m, int s, ZoneType z)[K[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;11H p.162[K[33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s);[35;17Hzone = z;[36;9H}[K[37;9Hvoid Write() const[K[20;9H[19;1H[18;3H[17;17H[16;22H[15;17H[14;23H[13;23H[12;23H[11;23H[10;23H[9;23H[8;21H[7;23H[6;23H[5;23H[4;23H[3;23H[3;1H//[K[4;1H// ...[K[5;1H//[K[6;1H// File: time3.cpp[K[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: OOP inheritance - Time, ExtTime, ...[10;1H//[K[11;9H[K[12;1H#include <iostream>[K[13;9H[K[14;1Husing namespace std;[K[15;25H[K[16;1Hclass Time[K[17;1H{ int hrs, mins, secs;[18;1Hpublic:[19;9H// constructors[20;1H Time() // 0:0:0[21;1H { hrs = 0; mins = secs = 0; }[K[22;9HTime(int h, int m, int s)[23;1H { hrs = h; mins = m; secs = s; }[K[24;1H void Set(int h, int m, int s)[25;1H { hrs = h; mins = m; secs = s; }[26;1H // observers[27;9Hvoid Write() const // hh:mm:ss[28;17Hcout << hrs << ":" << mins << ":" << secs; }[29;9Hvoid Increment()[K[30;9H{ secs ++; }[31;9Hbool Equal( Time x) const[32;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[33;9H return true;[K[34;9H else return false[35;9H}[K[36;1H};[K[37;9H[K[20;17H[19;23H[18;8H[17;23H[16;11H[15;1H[14;21H[13;1H[12;20H[11;1H[10;3H[11;1H[12;20H[13;1H#include[13;10H<[13;10H [13;10H[13;9H[13;8H [13;8H[13;7H [13;7H[13;6H [13;6H[13;5H [13;5H[13;4H [13;4H[13;3H [13;3H[13;2H [13;2H[13;1H [13;1H[14;1H[15;1H[16;1H[15;1H[14;1H[13;1H#include[13;10H"time.h";[13;18H [13;18H[14;18H[15;1H[16;11H[16;10H[16;9H[16;8H[16;7H[16;6H[16;5H[16;4H[16;3H[16;2H[16;1H{ int hrs, mins, secs;[17;1Hpublic:[K[18;1H // constructors[19;9HTime() // 0:0:0[20;9H{ hrs = 0; mins = secs = 0; }[21;9HTime(int h, int m, int s)[K[22;9H{ hrs = h; mins = m; secs = s; }[23;9Hvoid Set(int h, int m, int s)[K[24;9H{ hrs = h; mins = m; secs = s; }[25;9H// observers[K[26;9Hvoid Write() const // hh:mm:ss[27;9H{ cout << hrs << ":" << mins << ":" << secs; }[28;9Hvoid Increment()[K[29;9H{ secs ++; }[30;9Hbool Equal( Time x) const[31;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[32;9H return true;[K[33;17Helse return false;[34;9H}[K[35;1H};[K[36;1H [37;1H// p.159[16;1Hpublic:[K[17;1H // constructors[18;9HTime() // 0:0:0[19;9H{ hrs = 0; mins = secs = 0; }[20;9HTime(int h, int m, int s)[K[21;9H{ hrs = h; mins = m; secs = s; }[22;9Hvoid Set(int h, int m, int s)[K[23;9H{ hrs = h; mins = m; secs = s; }[24;9H// observers[K[25;9Hvoid Write() const // hh:mm:ss[26;9H{ cout << hrs << ":" << mins << ":" << secs; }[27;9Hvoid Increment()[K[28;9H{ secs ++; }[29;9Hbool Equal( Time x) const[30;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[31;9H return true;[K[32;17Helse return false;[33;9H}[K[34;1H};[K[35;1H [36;1H// p.159[37;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[16;1H // constructors[17;9HTime() // 0:0:0[18;9H{ hrs = 0; mins = secs = 0; }[19;9HTime(int h, int m, int s)[K[20;9H{ hrs = h; mins = m; secs = s; }[21;9Hvoid Set(int h, int m, int s)[K[22;9H{ hrs = h; mins = m; secs = s; }[23;9H// observers[K[24;9Hvoid Write() const // hh:mm:ss[25;9H{ cout << hrs << ":" << mins << ":" << secs; }[26;9Hvoid Increment()[K[27;9H{ secs ++; }[28;9Hbool Equal( Time x) const[29;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[30;9H return true;[K[31;17Helse return false;[32;9H}[K[33;1H};[K[34;1H [35;1H// p.159[36;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[37;1H[K[16;1H[16;9HTime() // 0:0:0[17;9H{ hrs = 0; mins = secs = 0; }[18;9HTime(int h, int m, int s)[K[19;9H{ hrs = h; mins = m; secs = s; }[20;9Hvoid Set(int h, int m, int s)[K[21;9H{ hrs = h; mins = m; secs = s; }[22;9H// observers[K[23;9Hvoid Write() const // hh:mm:ss[24;9H{ cout << hrs << ":" << mins << ":" << secs; }[25;9Hvoid Increment()[K[26;9H{ secs ++; }[27;9Hbool Equal( Time x) const[28;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[29;9H return true;[K[30;17Helse return false;[31;9H}[K[32;1H};[K[33;1H [34;1H// p.159[35;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[36;1H[K[37;1H// define a new class - subclass ExtTime from superclass Time[16;1H[16;9H{ hrs = 0; mins = secs = 0; }[17;9HTime(int h, int m, int s)[K[18;9H{ hrs = h; mins = m; secs = s; }[19;9Hvoid Set(int h, int m, int s)[K[20;9H{ hrs = h; mins = m; secs = s; }[21;9H// observers[K[22;9Hvoid Write() const // hh:mm:ss[23;9H{ cout << hrs << ":" << mins << ":" << secs; }[24;9Hvoid Increment()[K[25;9H{ secs ++; }[26;9Hbool Equal( Time x) const[27;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[28;9H return true;[K[29;17Helse return false;[30;9H}[K[31;1H};[K[32;1H [33;1H// p.159[34;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[35;1H[K[36;1H// define a new class - subclass ExtTime from superclass Time[37;1Hclass ExtTime : public Time[K[16;1H[16;9HTime(int h, int m, int s)[K[17;9H{ hrs = h; mins = m; secs = s; }[18;9Hvoid Set(int h, int m, int s)[K[19;9H{ hrs = h; mins = m; secs = s; }[20;9H// observers[K[21;9Hvoid Write() const // hh:mm:ss[22;9H{ cout << hrs << ":" << mins << ":" << secs; }[23;9Hvoid Increment()[K[24;9H{ secs ++; }[25;9Hbool Equal( Time x) const[26;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[27;9H return true;[K[28;17Helse return false;[29;9H}[K[30;1H};[K[31;1H [32;1H// p.159[33;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[34;1H[K[35;1H// define a new class - subclass ExtTime from superclass Time[36;1Hclass ExtTime : public Time[K[37;1H{ ZoneType zone; // extra data member[16;1H[16;9H{ hrs = h; mins = m; secs = s; }[17;9Hvoid Set(int h, int m, int s)[K[18;9H{ hrs = h; mins = m; secs = s; }[19;9H// observers[K[20;9Hvoid Write() const // hh:mm:ss[21;9H{ cout << hrs << ":" << mins << ":" << secs; }[22;9Hvoid Increment()[K[23;9H{ secs ++; }[24;9Hbool Equal( Time x) const[25;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[26;9H return true;[K[27;17Helse return false;[28;9H}[K[29;1H};[K[30;1H [31;1H// p.159[32;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[33;1H[K[34;1H// define a new class - subclass ExtTime from superclass Time[35;1Hclass ExtTime : public Time[K[36;1H{ ZoneType zone; // extra data member[37;1Hpublic:[K[16;1H[16;9Hvoid Set(int h, int m, int s)[K[17;9H{ hrs = h; mins = m; secs = s; }[18;9H// observers[K[19;9Hvoid Write() const // hh:mm:ss[20;9H{ cout << hrs << ":" << mins << ":" << secs; }[21;9Hvoid Increment()[K[22;9H{ secs ++; }[23;9Hbool Equal( Time x) const[24;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[25;9H return true;[K[26;17Helse return false;[27;9H}[K[28;1H};[K[29;1H [30;1H// p.159[31;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[32;1H[K[33;1H// define a new class - subclass ExtTime from superclass Time[34;1Hclass ExtTime : public Time[K[35;1H{ ZoneType zone; // extra data member[36;1Hpublic:[K[37;1H ExtTime() // 0:0:0 EST[16;1H[16;9H{ hrs = h; mins = m; secs = s; }[17;9H// observers[K[18;9Hvoid Write() const // hh:mm:ss[19;9H{ cout << hrs << ":" << mins << ":" << secs; }[20;9Hvoid Increment()[K[21;9H{ secs ++; }[22;9Hbool Equal( Time x) const[23;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[24;9H return true;[K[25;17Helse return false;[26;9H}[K[27;1H};[K[28;1H [29;1H// p.159[30;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[31;1H[K[32;1H// define a new class - subclass ExtTime from superclass Time[33;1Hclass ExtTime : public Time[K[34;1H{ ZoneType zone; // extra data member[35;1Hpublic:[K[36;1H ExtTime() // 0:0:0 EST[37;9H{ zone = EST; } [16;1H[16;9H// observers[K[17;9Hvoid Write() const // hh:mm:ss[18;9H{ cout << hrs << ":" << mins << ":" << secs; }[19;9Hvoid Increment()[K[20;9H{ secs ++; }[21;9Hbool Equal( Time x) const[22;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[23;9H return true;[K[24;17Helse return false;[25;9H}[K[26;1H};[K[27;1H [28;1H// p.159[29;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[30;1H[K[31;1H// define a new class - subclass ExtTime from superclass Time[32;1Hclass ExtTime : public Time[K[33;1H{ ZoneType zone; // extra data member[34;1Hpublic:[K[35;1H ExtTime() // 0:0:0 EST[36;9H{ zone = EST; } [37;9HExtTime(int h, int m, int s, ZoneType z)[16;1H[16;9Hvoid Write() const // hh:mm:ss[17;9H{ cout << hrs << ":" << mins << ":" << secs; }[18;9Hvoid Increment()[K[19;9H{ secs ++; }[20;9Hbool Equal( Time x) const[21;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[22;9H return true;[K[23;17Helse return false;[24;9H}[K[25;1H};[K[26;1H [27;1H// p.159[28;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[29;1H[K[30;1H// define a new class - subclass ExtTime from superclass Time[31;1Hclass ExtTime : public Time[K[32;1H{ ZoneType zone; // extra data member[33;1Hpublic:[K[34;1H ExtTime() // 0:0:0 EST[35;9H{ zone = EST; } [36;9HExtTime(int h, int m, int s, ZoneType z)[37;9H: Time (h, m, s)[K[16;1H[16;9H{ cout << hrs << ":" << mins << ":" << secs; }[17;9Hvoid Increment()[K[18;9H{ secs ++; }[19;9Hbool Equal( Time x) const[20;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[21;9H return true;[K[22;17Helse return false;[23;9H}[K[24;1H};[K[25;1H [26;1H// p.159[27;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[28;1H[K[29;1H// define a new class - subclass ExtTime from superclass Time[30;1Hclass ExtTime : public Time[K[31;1H{ ZoneType zone; // extra data member[32;1Hpublic:[K[33;1H ExtTime() // 0:0:0 EST[34;9H{ zone = EST; } [35;9HExtTime(int h, int m, int s, ZoneType z)[36;9H: Time (h, m, s)[K[37;9H{ zone = z; }[16;1H[16;9Hvoid Increment()[K[17;9H{ secs ++; }[18;9Hbool Equal( Time x) const[19;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[20;9H return true;[K[21;17Helse return false;[22;9H}[K[23;1H};[K[24;1H [25;1H// p.159[26;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[27;1H[K[28;1H// define a new class - subclass ExtTime from superclass Time[29;1Hclass ExtTime : public Time[K[30;1H{ ZoneType zone; // extra data member[31;1Hpublic:[K[32;1H ExtTime() // 0:0:0 EST[33;9H{ zone = EST; } [34;9HExtTime(int h, int m, int s, ZoneType z)[35;9H: Time (h, m, s)[K[36;9H{ zone = z; }[37;9H// p.162[K[16;1H[16;9H{ secs ++; }[17;9Hbool Equal( Time x) const[18;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[19;9H return true;[K[20;17Helse return false;[21;9H}[K[22;1H};[K[23;1H [24;1H// p.159[25;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[26;1H[K[27;1H// define a new class - subclass ExtTime from superclass Time[28;1Hclass ExtTime : public Time[K[29;1H{ ZoneType zone; // extra data member[30;1Hpublic:[K[31;1H ExtTime() // 0:0:0 EST[32;9H{ zone = EST; } [33;9HExtTime(int h, int m, int s, ZoneType z)[34;9H: Time (h, m, s)[K[35;9H{ zone = z; }[36;9H// p.162[K[37;9Hvoid Set(int h, int m, int s, ZoneType z)[16;1H[16;9Hbool Equal( Time x) const[17;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[18;9H return true;[K[19;17Helse return false;[20;9H}[K[21;1H};[K[22;1H [23;1H// p.159[24;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[25;1H[K[26;1H// define a new class - subclass ExtTime from superclass Time[27;1Hclass ExtTime : public Time[K[28;1H{ ZoneType zone; // extra data member[29;1Hpublic:[K[30;1H ExtTime() // 0:0:0 EST[31;9H{ zone = EST; } [32;9HExtTime(int h, int m, int s, ZoneType z)[33;9H: Time (h, m, s)[K[34;9H{ zone = z; }[35;9H// p.162[K[36;9Hvoid Set(int h, int m, int s, ZoneType z)[37;9H{ Time :: Set(h, m, s);[K[16;1H[16;9H{ if(hrs==x.hrs && mins==x.mins && secs==x.secs)[17;9H return true;[K[18;17Helse return false;[19;9H}[K[20;1H};[K[21;1H [22;1H// p.159[23;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[24;1H[K[25;1H// define a new class - subclass ExtTime from superclass Time[26;1Hclass ExtTime : public Time[K[27;1H{ ZoneType zone; // extra data member[28;1Hpublic:[K[29;1H ExtTime() // 0:0:0 EST[30;9H{ zone = EST; } [31;9HExtTime(int h, int m, int s, ZoneType z)[32;9H: Time (h, m, s)[K[33;9H{ zone = z; }[34;9H// p.162[K[35;9Hvoid Set(int h, int m, int s, ZoneType z)[36;9H{ Time :: Set(h, m, s);[K[37;9H zone = z;[K[16;1H[16;9H return true;[K[17;17Helse return false;[18;9H}[K[19;1H};[K[20;1H [21;1H// p.159[22;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[23;1H[K[24;1H// define a new class - subclass ExtTime from superclass Time[25;1Hclass ExtTime : public Time[K[26;1H{ ZoneType zone; // extra data member[27;1Hpublic:[K[28;1H ExtTime() // 0:0:0 EST[29;9H{ zone = EST; } [30;9HExtTime(int h, int m, int s, ZoneType z)[31;9H: Time (h, m, s)[K[32;9H{ zone = z; }[33;9H// p.162[K[34;9Hvoid Set(int h, int m, int s, ZoneType z)[35;9H{ Time :: Set(h, m, s);[K[36;9H zone = z;[K[37;9H}[K[16;1H[16;17Helse return false;[17;9H}[K[18;1H};[K[19;1H [20;1H// p.159[21;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[22;1H[K[23;1H// define a new class - subclass ExtTime from superclass Time[24;1Hclass ExtTime : public Time[K[25;1H{ ZoneType zone; // extra data member[26;1Hpublic:[K[27;1H ExtTime() // 0:0:0 EST[28;9H{ zone = EST; } [29;9HExtTime(int h, int m, int s, ZoneType z)[30;9H: Time (h, m, s)[K[31;9H{ zone = z; }[32;9H// p.162[K[33;9Hvoid Set(int h, int m, int s, ZoneType z)[34;9H{ Time :: Set(h, m, s);[K[35;9H zone = z;[K[36;9H}[K[37;9Hvoid Write() const[16;1H[16;9H}[K[17;1H};[K[18;1H [19;1H// p.159[20;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[21;1H[K[22;1H// define a new class - subclass ExtTime from superclass Time[23;1Hclass ExtTime : public Time[K[24;1H{ ZoneType zone; // extra data member[25;1Hpublic:[K[26;1H ExtTime() // 0:0:0 EST[27;9H{ zone = EST; } [28;9HExtTime(int h, int m, int s, ZoneType z)[29;9H: Time (h, m, s)[K[30;9H{ zone = z; }[31;9H// p.162[K[32;9Hvoid Set(int h, int m, int s, ZoneType z)[33;9H{ Time :: Set(h, m, s);[K[34;9H zone = z;[K[35;9H}[K[36;9Hvoid Write() const[37;9H{ Time :: Write(); // hh:mm:ss[16;1H};[K[17;1H [18;1H// p.159[19;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[20;1H[K[21;1H// define a new class - subclass ExtTime from superclass Time[22;1Hclass ExtTime : public Time[K[23;1H{ ZoneType zone; // extra data member[24;1Hpublic:[K[25;1H ExtTime() // 0:0:0 EST[26;9H{ zone = EST; } [27;9HExtTime(int h, int m, int s, ZoneType z)[28;9H: Time (h, m, s)[K[29;9H{ zone = z; }[30;9H// p.162[K[31;9Hvoid Set(int h, int m, int s, ZoneType z)[32;9H{ Time :: Set(h, m, s);[K[33;9H zone = z;[K[34;9H}[K[35;9Hvoid Write() const[36;9H{ Time :: Write(); // hh:mm:ss[37;9H string zoneString[] = {"EST", "CST", "MST", "PST",[16;1H [17;1H// p.159[18;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[19;1H[K[20;1H// define a new class - subclass ExtTime from superclass Time[21;1Hclass ExtTime : public Time[K[22;1H{ ZoneType zone; // extra data member[23;1Hpublic:[K[24;1H ExtTime() // 0:0:0 EST[25;9H{ zone = EST; } [26;9HExtTime(int h, int m, int s, ZoneType z)[27;9H: Time (h, m, s)[K[28;9H{ zone = z; }[29;9H// p.162[K[30;9Hvoid Set(int h, int m, int s, ZoneType z)[31;9H{ Time :: Set(h, m, s);[K[32;9H zone = z;[K[33;9H}[K[34;9Hvoid Write() const[35;9H{ Time :: Write(); // hh:mm:ss[36;9H string zoneString[] = {"EST", "CST", "MST", "PST",[37;17H "EDT", "CDT", "MDT", "PDT"};[K[16;1H// p.159[17;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[18;1H[K[19;1H// define a new class - subclass ExtTime from superclass Time[20;1Hclass ExtTime : public Time[K[21;1H{ ZoneType zone; // extra data member[22;1Hpublic:[K[23;1H ExtTime() // 0:0:0 EST[24;9H{ zone = EST; } [25;9HExtTime(int h, int m, int s, ZoneType z)[26;9H: Time (h, m, s)[K[27;9H{ zone = z; }[28;9H// p.162[K[29;9Hvoid Set(int h, int m, int s, ZoneType z)[30;9H{ Time :: Set(h, m, s);[K[31;9H zone = z;[K[32;9H}[K[33;9Hvoid Write() const[34;9H{ Time :: Write(); // hh:mm:ss[35;9H string zoneString[] = {"EST", "CST", "MST", "PST",[36;17H "EDT", "CDT", "MDT", "PDT"};[K[37;17Hcout << " " << zoneString[zone];[K[16;1H[15;1H[14;1H[13;1H[14;1H[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mtime3.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;31H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 56 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico time3.cpp./a.out[Kpico time3.cpp./a.out[Kg++ time3.cpp time3.cpp:15: multiple definition of `enum ZoneType' time.h:32: previous definition here time3.cpp:15: conflicting types for `EST' time.h:32: previous declaration as `ZoneType EST' time3.cpp:15: conflicting types for `CST' time.h:32: previous declaration as `ZoneType CST' time3.cpp:15: conflicting types for `MST' time.h:32: previous declaration as `ZoneType MST' time3.cpp:15: conflicting types for `PST' time.h:32: previous declaration as `ZoneType PST' time3.cpp:15: conflicting types for `EDT' time.h:32: previous declaration as `ZoneType EDT' time3.cpp:15: conflicting types for `CDT' time.h:32: previous declaration as `ZoneType CDT' time3.cpp:15: conflicting types for `MDT' time.h:32: previous declaration as `ZoneType MDT' time3.cpp:15: conflicting types for `PDT' time.h:32: previous declaration as `ZoneType PDT' time3.cpp:19: redefinition of `class ExtTime' time.h:36: previous definition of `class ExtTime' time3.cpp: In function `int main()': time3.cpp:40: redefinition of `int main()' time.h:57: `int main()' previously defined here [kmmowery@zeus cs212]$ g++ time3.cpppico time3.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;64H[7m[ Reading file ][m[38;1H[K[38;63H[7m[ Read 56 lines ][m[1;66H[7mFile: time3.cpp[m[3;1H//[4;1H// ...[5;1H//[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: OOP inheritance - Time, ExtTime, ...[10;1H//[12;1H#include <iostream>[13;1H#include "time.h"[14;1Husing namespace std;[16;1H// p.159[17;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[19;1H// define a new class - subclass ExtTime from superclass Time[20;1Hclass ExtTime : public Time[21;1H{ ZoneType zone; // extra data member[22;1Hpublic:[23;9HExtTime() // 0:0:0 EST[24;9H{ zone = EST; }[25;9HExtTime(int h, int m, int s, ZoneType z)[26;9H: Time (h, m, s)[27;9H{ zone = z; }[28;9H// p.162[29;9Hvoid Set(int h, int m, int s, ZoneType z)[30;9H{ Time :: Set(h, m, s);[31;17Hzone = z;[32;9H}[33;9Hvoid Write() const[34;9H{ Time :: Write(); // hh:mm:ss[35;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[36;33H"EDT", "CDT", "MDT", "PDT"};[37;17Hcout << " " << zoneString[zone];[3;1H[4;1H[5;1H[6;1H[7;1H[8;1H[9;1H[10;1H[11;1H[12;1H[13;1H[14;1H[15;1H[16;1H[17;1H[16;1H[15;1H[14;1H[15;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;3H[38;1H[K[10;2H[10;1H[9;61H[8;36H[9;61H[9;60H[1;132H[7mModified[m[9;9H[K[10;1H [11;1H#include <iostream>[12;10H"time.h" [13;1Husing namespace std;[14;1H[K[15;1H// p.159[16;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[17;1H[K[18;1H// define a new class - subclass ExtTime from superclass Time[19;1Hclass ExtTime : public Time[K[20;1H{ ZoneType zone; // extra data member[21;1Hpublic:[K[22;1H ExtTime() // 0:0:0 EST[23;9H{ zone = EST; } [24;9HExtTime(int h, int m, int s, ZoneType z)[25;9H: Time (h, m, s)[K[26;9H{ zone = z; }[27;9H// p.162[K[28;9Hvoid Set(int h, int m, int s, ZoneType z)[29;9H{ Time :: Set(h, m, s);[K[30;9H zone = z;[K[31;9H}[K[32;9Hvoid Write() const[33;9H{ Time :: Write(); // hh:mm:ss[34;9H string zoneString[] = {"EST", "CST", "MST", "PST",[35;17H "EDT", "CDT", "MDT", "PDT"};[K[36;17Hcout << " " << zoneString[zone];[K[37;9H}[K[9;1H[9;3H/[9;2H[9;4H/[9;3H [10;1H//[11;1H[K[12;10H<iostream>[13;1H#include "time.h" [14;1Husing namespace std;[15;1H[K[16;1H// p.159[K[17;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[18;1H[K[19;1H// define a new class - subclass ExtTime from superclass Time[20;1Hclass ExtTime : public Time[K[21;1H{ ZoneType zone; // extra data member[22;1Hpublic:[K[23;9HExtTime() // 0:0:0 EST[24;9H{ zone = EST; }[K[25;9HExtTime(int h, int m, int s, ZoneType z)[26;9H: Time (h, m, s)[K[27;9H{ zone = z; }[28;9H// p.162[K[29;9Hvoid Set(int h, int m, int s, ZoneType z)[30;9H{ Time :: Set(h, m, s);[31;9H zone = z;[32;9H}[K[33;9Hvoid Write() const[K[34;9H{ Time :: Write(); // hh:mm:ss[K[35;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[36;17H "EDT", "CDT", "MDT", "PDT"};[37;9H cout << " " << zoneString[zone];[10;1H[9;3H[9;9HGOA[9;11H [9;11H[9;10H [9;10Hoal:[9;17H[9;25Husing[9;31Hthe[9;35Huser-defibed[9;48Hh[9;48H [9;48H[9;47H[9;46H [9;46H[9;45H [9;45H[9;44H [9;44Hned[9;48Hheader[9;55Htime.h[9;62Hto[9;65Hcompile[39;1H [7mY[m Yes [K[40;2H[7mC[m Cancel [7mN[m No [K[38;1H[K[7mSave modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? [38;62H[m[7mYes[m[38;1H[K[7mFile Name to write : [38;22H[m[7mtime3.cpp[m[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mT[m To Files [K[40;24H[7mT[m[7mA[m[7mB[m Complete [K[7m[38;31H[m[38;1H[K[38;65H[7m[ Writing... ][m[38;1H[K[38;63H[7m[ Wrote 56 lines ][m[39;1H[K[40;1H[K[kmmowery@zeus cs212]$ pico time3.cppg++ time3.cpp[K In file included from time3.cpp:11: time.h:5:19: warning: extra tokens at end of #ifndef directive time.h:5:1: unterminated #ifndef [kmmowery@zeus cs212]$ g++ time3.cpppico time3.cpp [1;1H[J[7m UW PICO(tm) 4.2 New Buffer [m[39;1H[K[40;1H[K[39;1H[7m^[m[7mG[m Get Help [7m^[m[7mO[m WriteOut [7m^[m[7mR[m Read File [7m^[m[7mY[m Prev Pg [7m^[m[7mK[m Cut Text [7m^[m[7mC[m Cur Pos [K[40;1H[7m^[m[7mX[m Exit [7m^[m[7mJ[m Justify [7m^[m[7mW[m Where is [7m^[m[7mV[m Next Pg [7m^[m[7mU[m UnCut Text [7m^[m[7mT[m To Spell [K[3;1H[38;1H[K[38;64H[7m[ Reading file ][m[38;1H[K[38;63H[7m[ Read 56 lines ][m[1;66H[7mFile: time3.cpp[m[3;1H//[4;1H// ...[5;1H//[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: using the user-defined header time.h to compile[10;1H//[12;1H#include <iostream>[13;1H#include "time.h"[14;1Husing namespace std;[16;1H// p.159[17;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[19;1H// define a new class - subclass ExtTime from superclass Time[20;1Hclass ExtTime : public Time[21;1H{ ZoneType zone; // extra data member[22;1Hpublic:[23;9HExtTime() // 0:0:0 EST[24;9H{ zone = EST; }[25;9HExtTime(int h, int m, int s, ZoneType z)[26;9H: Time (h, m, s)[27;9H{ zone = z; }[28;9H// p.162[29;9Hvoid Set(int h, int m, int s, ZoneType z)[30;9H{ Time :: Set(h, m, s);[31;17Hzone = z;[32;9H}[33;9Hvoid Write() const[34;9H{ Time :: Write(); // hh:mm:ss[35;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[36;33H"EDT", "CDT", "MDT", "PDT"};[37;17Hcout << " " << zoneString[zone];[3;1H[4;1H[5;1H[6;1H[7;1H[8;1H[9;1H[10;1H[11;1H[12;1H[13;1H[14;1H[15;1H[16;1H[15;1H[14;1H[1;132H[7mModified[m[14;1H[K[15;1Husing namespace std;[16;1H[K[17;1H// p.159[K[18;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[19;1H[K[20;1H// define a new class - subclass ExtTime from superclass Time[21;1Hclass ExtTime : public Time[K[22;1H{ ZoneType zone; // extra data member[23;1Hpublic:[K[24;9HExtTime() // 0:0:0 EST[25;9H{ zone = EST; }[K[26;9HExtTime(int h, int m, int s, ZoneType z)[27;9H: Time (h, m, s)[K[28;9H{ zone = z; }[29;9H// p.162[K[30;9Hvoid Set(int h, int m, int s, ZoneType z)[31;9H{ Time :: Set(h, m, s);[32;9H zone = z;[33;9H}[K[34;9Hvoid Write() const[K[35;9H{ Time :: Write(); // hh:mm:ss[K[36;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[37;17H "EDT", "CDT", "MDT", "PDT"};[15;1H[14;1H#include[38;1H[K[14;10H<[14;10H [14;10H"exittime.h"[15;1H[K[16;1Husing namespace std;[17;1H[K[18;1H// p.159[K[19;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[20;1H[K[21;1H// define a new class - subclass ExtTime from superclass Time[22;1Hclass ExtTime : public Time[K[23;1H{ ZoneType zone; // extra data member[24;1Hpublic:[K[25;9HExtTime() // 0:0:0 EST[26;9H{ zone = EST; }[K[27;9HExtTime(int h, int m, int s, ZoneType z)[28;9H: Time (h, m, s)[K[29;9H{ zone = z; }[30;9H// p.162[K[31;9Hvoid Set(int h, int m, int s, ZoneType z)[32;9H{ Time :: Set(h, m, s);[33;9H zone = z;[34;9H}[K[35;9Hvoid Write() const[K[36;9H{ Time :: Write(); // hh:mm:ss[K[37;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[15;1H[16;1H[17;1H[18;1H[19;1H[20;1H[19;1H[18;1H[17;1H[16;21H[15;1H[14;21H[14;20H[14;19H[14;18H[14;17H[14;16H[14;15H[14;14H[14;13Httime.h" [14;13H[15;1H[16;13H[17;1H[18;9H[18;8H[18;7H[18;6H[19;6H[19;5H[19;4H[19;3H[19;2H[19;1H[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;4Hdefine a new class - subclass ExtTime from superclass Time[4;1Hclass ExtTime : public Time[5;1H{ ZoneType zone; // extra data member[6;1Hpublic:[K[7;1H ExtTime() // 0:0:0 EST[K[8;1H { zone = EST; } [9;1H ExtTime(int h, int m, int s, ZoneType z)[K[10;1H : Time (h, m, s)[11;9H{ zone = z; }[12;1H // p.162 [13;1H void Set(int h, int m, int s, ZoneType z)[14;1H { Time :: Set(h, m, s);[15;17Hzone = z;[16;1H }[K[17;9Hvoid Write() const[18;1H { Time :: Write(); // hh:mm:ss[19;1H string zoneString[] = {"EST", "CST", "MST", "PST",[20;33H"EDT", "CDT", "MDT", "PDT"};[21;1H cout << " " << zoneString[zone];[K[22;1H }[K[23;1H};[K[24;1H[K[25;1Hint main()[K[26;1H{[K[27;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[28;9HExtTime x(13, 30, 0, EST);[29;9H[K[30;11HQ: change x to 14:45:00 EST;[31;9Hx.Set(14, 45, 0, EST );[K[32;9H[K[33;17H[K[34;9H// Q: Out[35;9Hx.Write(); // 14:45:00[36;9H[K[37;17H[K[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[28;1H[27;1H[26;1H[25;1H[24;1H[23;1H[22;1H[21;1H[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H[3;4H[K[4;1H// ...[K[5;1H//[K[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: using the user-defined header time.h to compile[10;1H//[K[11;9H[K[12;1H#include <iostream>[13;1H#include "time.h"[K[14;1H#include "exttime.h"[K[15;17H[K[16;1Husing namespace std;[17;9H[K[18;1H// p.159[K[19;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[K[20;33H[K[21;1H// define a new class - subclass ExtTime from superclass Time[22;1Hclass ExtTime : public Time[23;1H{ ZoneType zone; // extra data member[24;1Hpublic:[25;1H ExtTime() // 0:0:0 EST[26;1H { zone = EST; }[27;9HExtTime(int h, int m, int s, ZoneType z)[K[28;9H: Time (h, m, s)[K[29;9H{ zone = z; }[30;11H p.162[K[31;9Hvoid Set(int h, int m, int s, ZoneType z)[32;9H{ Time :: Set(h, m, s);[33;17Hzone = z;[34;9H}[K[35;9Hvoid Write() const[K[36;9H{ Time :: Write(); // hh:mm:ss[37;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[20;1H[21;1H[20;1H[19;1H[18;1Henum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};[19;1H[K[20;1H// define a new class - subclass ExtTime from superclass Time[21;1Hclass ExtTime : public Time[K[22;1H{ ZoneType zone; // extra data member[23;1Hpublic:[K[24;1H ExtTime() // 0:0:0 EST[25;9H{ zone = EST; } [26;9HExtTime(int h, int m, int s, ZoneType z)[27;9H: Time (h, m, s)[K[28;9H{ zone = z; }[29;9H// p.162[K[30;9Hvoid Set(int h, int m, int s, ZoneType z)[31;9H{ Time :: Set(h, m, s);[K[32;9H zone = z;[K[33;9H}[K[34;9Hvoid Write() const[35;9H{ Time :: Write(); // hh:mm:ss[36;9H string zoneString[] = {"EST", "CST", "MST", "PST",[37;17H "EDT", "CDT", "MDT", "PDT"};[K[18;1H[K[19;1H// define a new class - subclass ExtTime from superclass Time[20;1Hclass ExtTime : public Time[K[21;1H{ ZoneType zone; // extra data member[22;1Hpublic:[K[23;1H ExtTime() // 0:0:0 EST[24;9H{ zone = EST; } [25;9HExtTime(int h, int m, int s, ZoneType z)[26;9H: Time (h, m, s)[K[27;9H{ zone = z; }[28;9H// p.162[K[29;9Hvoid Set(int h, int m, int s, ZoneType z)[30;9H{ Time :: Set(h, m, s);[K[31;9H zone = z;[K[32;9H}[K[33;9Hvoid Write() const[34;9H{ Time :: Write(); // hh:mm:ss[35;9H string zoneString[] = {"EST", "CST", "MST", "PST",[36;17H "EDT", "CDT", "MDT", "PDT"};[K[37;17Hcout << " " << zoneString[zone];[K[18;1H// define a new class - subclass ExtTime from superclass Time[19;1Hclass ExtTime : public Time[K[20;1H{ ZoneType zone; // extra data member[21;1Hpublic:[K[22;1H ExtTime() // 0:0:0 EST[23;9H{ zone = EST; } [24;9HExtTime(int h, int m, int s, ZoneType z)[25;9H: Time (h, m, s)[K[26;9H{ zone = z; }[27;9H// p.162[K[28;9Hvoid Set(int h, int m, int s, ZoneType z)[29;9H{ Time :: Set(h, m, s);[K[30;9H zone = z;[K[31;9H}[K[32;9Hvoid Write() const[33;9H{ Time :: Write(); // hh:mm:ss[34;9H string zoneString[] = {"EST", "CST", "MST", "PST",[35;17H "EDT", "CDT", "MDT", "PDT"};[K[36;17Hcout << " " << zoneString[zone];[K[37;9H}[K[18;1Hclass ExtTime : public Time[K[19;1H{ ZoneType zone; // extra data member[20;1Hpublic:[K[21;1H ExtTime() // 0:0:0 EST[22;9H{ zone = EST; } [23;9HExtTime(int h, int m, int s, ZoneType z)[24;9H: Time (h, m, s)[K[25;9H{ zone = z; }[26;9H// p.162[K[27;9Hvoid Set(int h, int m, int s, ZoneType z)[28;9H{ Time :: Set(h, m, s);[K[29;9H zone = z;[K[30;9H}[K[31;9Hvoid Write() const[32;9H{ Time :: Write(); // hh:mm:ss[33;9H string zoneString[] = {"EST", "CST", "MST", "PST",[34;17H "EDT", "CDT", "MDT", "PDT"};[K[35;17Hcout << " " << zoneString[zone];[K[36;9H}[K[37;1H};[K[18;1H[19;1H[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1H ExtTime() // 0:0:0 EST[4;1H { zone = EST; }[5;1H ExtTime(int h, int m, int s, ZoneType z)[6;1H : Time (h, m, s)[K[7;1H { zone = z; }[K[8;1H // p.162[K[9;1H void Set(int h, int m, int s, ZoneType z)[K[10;1H { Time :: Set(h, m, s);[11;17Hzone = z;[12;1H }[K[13;1H void Write() const[14;1H { Time :: Write(); // hh:mm:ss[15;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[16;1H "EDT", "CDT", "MDT", "PDT"};[17;17Hcout << " " << zoneString[zone];[18;1H }[K[19;1H};[K[20;1H[K[21;1Hint main()[K[22;1H{[K[23;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[24;9HExtTime x(13, 30, 0, EST);[25;9H[K[26;11HQ: change x to 14:45:00 EST;[27;9Hx.Set(14, 45, 0, EST );[K[28;9H[K[29;17H[K[30;9H// Q: Out[31;9Hx.Write(); // 14:45:00[32;9H[K[33;17H[K[34;9Hcout << "\n\nDone.\n\n";[K[35;9Hreturn 0;[K[36;1H}[K[37;1H [20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1Hint main()[K[4;1H{[K[5;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[6;9HExtTime x(13, 30, 0, EST);[7;9H[K[8;11HQ: change x to 14:45:00 EST;[9;9Hx.Set(14, 45, 0, EST );[K[10;9H[K[11;17H[K[12;9H// Q: Out[13;9Hx.Write(); // 14:45:00[14;9H[K[15;17H[K[16;9Hcout << "\n\nDone.\n\n";[K[17;9Hreturn 0;[K[18;1H}[K[19;1H [21;1H[K[22;1H [23;9H[K[24;9H[K[26;9H[K[27;9H[K[30;9H[K[31;9H[K[34;9H[K[35;9H[K[36;1H [20;1H[21;1H[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H ExtTime() // 0:0:0 EST[4;1H { zone = EST; }[5;9HExtTime(int h, int m, int s, ZoneType z)[K[6;9H: Time (h, m, s)[K[7;9H{ zone = z; }[8;11H p.162[K[9;9Hvoid Set(int h, int m, int s, ZoneType z)[10;9H{ Time :: Set(h, m, s);[11;17Hzone = z;[12;9H}[K[13;9Hvoid Write() const[K[14;9H{ Time :: Write(); // hh:mm:ss[15;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[16;9H "EDT", "CDT", "MDT", "PDT"};[17;9H cout << " " << zoneString[zone];[18;1H }[19;1H};[21;1Hint main()[22;1H{[23;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[24;9HExtTime x(13, 30, 0, EST);[26;9H//Q: change x to 14:45:00 EST;[27;9Hx.Set(14, 45, 0, EST );[30;9H// Q: Out[31;9Hx.Write(); // 14:45:00[34;9Hcout << "\n\nDone.\n\n";[35;9Hreturn 0;[36;1H}[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H//[K[4;1H// ...[K[5;1H//[K[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: using the user-defined header time.h to compile[10;1H//[K[11;17H[K[12;1H#include <iostream>[13;1H#include "time.h"[K[14;1H#include "exttime.h"[K[15;17H[K[16;1Husing namespace std;[K[17;17H[K[18;1Hclass ExtTime : public Time[19;1H{ ZoneType zone; // extra data member[20;1Hpublic:[21;1H ExtTime() // 0:0:0 EST[22;1H { zone = EST; }[23;9HExtTime(int h, int m, int s, ZoneType z)[K[24;9H: Time (h, m, s)[K[25;9H{ zone = z; }[26;11H p.162[K[27;9Hvoid Set(int h, int m, int s, ZoneType z)[28;9H{ Time :: Set(h, m, s);[29;17Hzone = z;[30;9H}[K[31;9Hvoid Write() const[K[32;9H{ Time :: Write(); // hh:mm:ss[33;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[34;9H "EDT", "CDT", "MDT", "PDT"};[35;9H cout << " " << zoneString[zone];[36;1H }[37;1H};[20;1H[19;1H[18;1H[17;1H[18;1H[19;1H[18;1H[17;1H[16;1H[15;1H[16;1H[17;1H[18;1H[19;1H[20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[36;1H[37;1H[3;1H ExtTime() // 0:0:0 EST[4;1H { zone = EST; }[5;1H ExtTime(int h, int m, int s, ZoneType z)[6;1H : Time (h, m, s)[K[7;1H { zone = z; }[K[8;1H // p.162[K[9;1H void Set(int h, int m, int s, ZoneType z)[K[10;1H { Time :: Set(h, m, s);[11;17Hzone = z;[12;1H }[K[13;1H void Write() const[14;1H { Time :: Write(); // hh:mm:ss[15;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[16;1H "EDT", "CDT", "MDT", "PDT"};[17;17Hcout << " " << zoneString[zone];[18;1H }[K[19;1H};[K[20;1H[K[21;1Hint main()[K[22;1H{[K[23;9H// Q: Def. obj of ExtTime x with 13:30:00 EST?[24;9HExtTime x(13, 30, 0, EST);[25;9H[K[26;11HQ: change x to 14:45:00 EST;[27;9Hx.Set(14, 45, 0, EST );[K[28;9H[K[29;17H[K[30;9H// Q: Out[31;9Hx.Write(); // 14:45:00[32;9H[K[33;17H[K[34;9Hcout << "\n\nDone.\n\n";[K[35;9Hreturn 0;[K[36;1H}[K[37;1H [20;1H[21;1H[22;1H[23;1H[24;1H[25;1H[26;1H[27;1H[28;1H[29;1H[30;1H[31;1H[32;1H[33;1H[34;1H[35;1H[34;1H[33;1H[32;1H[31;1H[30;1H[29;1H[28;1H[27;1H[26;1H[25;1H[24;1H[23;1H[22;1H[21;1H[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[14;1H[13;1H[12;1H[11;1H[10;1H[9;1H[8;1H[7;1H[6;1H[5;1H[4;1H[3;1H//[K[4;1H// ...[K[5;1H//[K[6;1H// File: time3.cpp[7;1H// Compile: g++ time1.cpp -o time1.out[8;1H// Run: ./time.out[9;1H// Goal: using the user-defined header time.h to compile[10;1H//[K[11;17H[K[12;1H#include <iostream>[13;1H#include "time.h"[K[14;1H#include "exttime.h"[K[15;17H[K[16;1Husing namespace std;[K[17;17H[K[18;1Hclass ExtTime : public Time[19;1H{ ZoneType zone; // extra data member[20;1Hpublic:[21;1H ExtTime() // 0:0:0 EST[22;1H { zone = EST; }[23;9HExtTime(int h, int m, int s, ZoneType z)[K[24;9H: Time (h, m, s)[K[25;9H{ zone = z; }[26;11H p.162[K[27;9Hvoid Set(int h, int m, int s, ZoneType z)[28;9H{ Time :: Set(h, m, s);[29;17Hzone = z;[30;9H}[K[31;9Hvoid Write() const[K[32;9H{ Time :: Write(); // hh:mm:ss[33;17Hstring zoneString[] = {"EST", "CST", "MST", "PST",[34;9H "EDT", "CDT", "MDT", "PDT"};[35;9H cout << " " << zoneString[zone];[36;1H }[37;1H};[20;1H[19;1H[18;1H[17;1H[16;1H[15;1H[16;1H[17;1H[18;1H[19;1H[18;1H{ ZoneType zone; // extra data member[19;1Hpublic:[K[20;1H ExtTime() // 0:0:0 EST[21;9H{ zone = EST; } [22;9HExtTime(int h, int m, int s, ZoneType z)[23;9H: Time (h, m, s)[K[24;9H{ zone = z; }[25;9H// p.162[K[26;9Hvoid Set(int h, int m, int s, ZoneType z)[27;9H{ Time :: Set(h, m, s);[K[28;9H zone = z;[K[29;9H}[K[30;9Hvoid Write() const[31;9H{ Time :: Write(); // hh:mm:ss[32;9H string zoneString[] = {"EST", "CST", "MST", "PST",[33;17H "EDT", "CDT", "MDT", "PDT"};[K[34;17Hcout << " " << zoneString[zone];[K[35;9H}[K[36;1H};[K[37;1H [18;1Hpublic:[K[19;1H ExtTime() // 0:0:0 EST[20;9H{ zone = EST; } [21;9HExtTime(int h, int m, int s, ZoneType z)[22;9H: Time (h, m, s)[K[23;9H{ zone = z; }[24;9H// p.162[K[25;9Hvoid Set(int h, int m, int s, ZoneType z)[26;9H{ Time :: Set(h, m, s);[K[27;9H zone = z;[K[28;9H}[K[29;9Hvoid Write() const[30;9H{ Time :: Write(); // hh:mm:ss[31;9H string zoneString[] = {"EST", "CST", "MST", "PST",[32;17H "EDT", "CDT", "MDT", "PDT"};[K[33;17Hcout << " " << zoneString[zone];[K[34;9H}[K[35;1H};[K[36;1H [37;1Hint main()[18;1H ExtTime() // 0:0:0 EST[19;9H{ zone = EST; } [20;9HExtTime(int h, int m, int s, ZoneType z)[21;9H: Time (h, m, s)[K[22;9H{ zone = z; }[23;9H// p.162[K[24;9Hvoid Set(int h, int m, int s, ZoneType z)[25;9H{ Time :: Set(h, m, s);[K[26;9H zone = z;[K[27;9H}[K[28;9Hvoid Write() const[29;9H{ Time :: Write(); // hh:mm:ss[30;9H string zoneString[] = {"EST", "CST", "MST", "PST",[31;17H "EDT", "CDT", "MDT", "PDT"};[K[32;17Hcout << " " << zoneString[zone];[K[33;9H}[K[34;1H};[K[35;1H [36;1Hint main()[37;1H{[K[18;1H[18;9H{ zone = EST; } [19;9HExtTime(int h, int m, int s, ZoneType z)[20;9H: Time (h, m, s)[K[21;9H{ zone = z; }[22;9H// p.162[K[23;9Hvoid Set(int h, int m, int s, ZoneType z)[24;9H{ Time :: Set(h, m, s);[K[25;9H zone = z;[K[26;9H}[K[27;9Hvoid Write() const[28;9H{ Time :: Write(); // hh:mm:ss[29;9H string zoneString[] = {"EST", "CST", "MST", "PST",[30;17H "EDT", "CDT", "MDT", "PDT"};[K[31;17Hcout << " " << zoneString[zone];[K[32;9H}[K[33;1H};[K[34;1H [35;1Hint main()[36;1H{[K[37;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[18;1H[18;9HExtTime(int h, int m, int s, ZoneType z)[19;9H: Time (h, m, s)[K[20;9H{ zone = z; }[21;9H// p.162[K[22;9Hvoid Set(int h, int m, int s, ZoneType z)[23;9H{ Time :: Set(h, m, s);[K[24;9H zone = z;[K[25;9H}[K[26;9Hvoid Write() const[27;9H{ Time :: Write(); // hh:mm:ss[28;9H string zoneString[] = {"EST", "CST", "MST", "PST",[29;17H "EDT", "CDT", "MDT", "PDT"};[K[30;17Hcout << " " << zoneString[zone];[K[31;9H}[K[32;1H};[K[33;1H [34;1Hint main()[35;1H{[K[36;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[37;9HExtTime x(13, 30, 0, EST);[K[18;1H[18;9H: Time (h, m, s)[K[19;9H{ zone = z; }[20;9H// p.162[K[21;9Hvoid Set(int h, int m, int s, ZoneType z)[22;9H{ Time :: Set(h, m, s);[K[23;9H zone = z;[K[24;9H}[K[25;9Hvoid Write() const[26;9H{ Time :: Write(); // hh:mm:ss[27;9H string zoneString[] = {"EST", "CST", "MST", "PST",[28;17H "EDT", "CDT", "MDT", "PDT"};[K[29;17Hcout << " " << zoneString[zone];[K[30;9H}[K[31;1H};[K[32;1H [33;1Hint main()[34;1H{[K[35;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[36;9HExtTime x(13, 30, 0, EST);[K[37;9H[K[18;1H[18;9H{ zone = z; }[19;9H// p.162[K[20;9Hvoid Set(int h, int m, int s, ZoneType z)[21;9H{ Time :: Set(h, m, s);[K[22;9H zone = z;[K[23;9H}[K[24;9Hvoid Write() const[25;9H{ Time :: Write(); // hh:mm:ss[26;9H string zoneString[] = {"EST", "CST", "MST", "PST",[27;17H "EDT", "CDT", "MDT", "PDT"};[K[28;17Hcout << " " << zoneString[zone];[K[29;9H}[K[30;1H};[K[31;1H [32;1Hint main()[33;1H{[K[34;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[35;9HExtTime x(13, 30, 0, EST);[K[36;9H[K[37;9H//Q: change x to 14:45:00 EST;[18;1H[18;9H// p.162[K[19;9Hvoid Set(int h, int m, int s, ZoneType z)[20;9H{ Time :: Set(h, m, s);[K[21;9H zone = z;[K[22;9H}[K[23;9Hvoid Write() const[24;9H{ Time :: Write(); // hh:mm:ss[25;9H string zoneString[] = {"EST", "CST", "MST", "PST",[26;17H "EDT", "CDT", "MDT", "PDT"};[K[27;17Hcout << " " << zoneString[zone];[K[28;9H}[K[29;1H};[K[30;1H [31;1Hint main()[32;1H{[K[33;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[34;9HExtTime x(13, 30, 0, EST);[K[35;9H[K[36;9H//Q: change x to 14:45:00 EST;[37;9Hx.Set(14, 45, 0, EST );[K[18;1H[18;9Hvoid Set(int h, int m, int s, ZoneType z)[19;9H{ Time :: Set(h, m, s);[K[20;9H zone = z;[K[21;9H}[K[22;9Hvoid Write() const[23;9H{ Time :: Write(); // hh:mm:ss[24;9H string zoneString[] = {"EST", "CST", "MST", "PST",[25;17H "EDT", "CDT", "MDT", "PDT"};[K[26;17Hcout << " " << zoneString[zone];[K[27;9H}[K[28;1H};[K[29;1H [30;1Hint main()[31;1H{[K[32;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[33;9HExtTime x(13, 30, 0, EST);[K[34;9H[K[35;9H//Q: change x to 14:45:00 EST;[36;9Hx.Set(14, 45, 0, EST );[K[37;9H[K[18;1H[18;9H{ Time :: Set(h, m, s);[K[19;9H zone = z;[K[20;9H}[K[21;9Hvoid Write() const[22;9H{ Time :: Write(); // hh:mm:ss[23;9H string zoneString[] = {"EST", "CST", "MST", "PST",[24;17H "EDT", "CDT", "MDT", "PDT"};[K[25;17Hcout << " " << zoneString[zone];[K[26;9H}[K[27;1H};[K[28;1H [29;1Hint main()[30;1H{[K[31;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[32;9HExtTime x(13, 30, 0, EST);[K[33;9H[K[34;9H//Q: change x to 14:45:00 EST;[35;9Hx.Set(14, 45, 0, EST );[K[36;9H[K[18;1H[18;9H zone = z;[K[19;9H}[K[20;9Hvoid Write() const[21;9H{ Time :: Write(); // hh:mm:ss[22;9H string zoneString[] = {"EST", "CST", "MST", "PST",[23;17H "EDT", "CDT", "MDT", "PDT"};[K[24;17Hcout << " " << zoneString[zone];[K[25;9H}[K[26;1H};[K[27;1H [28;1Hint main()[29;1H{[K[30;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[31;9HExtTime x(13, 30, 0, EST);[K[32;9H[K[33;9H//Q: change x to 14:45:00 EST;[34;9Hx.Set(14, 45, 0, EST );[K[35;9H[K[37;9H// Q: Out[18;1H[18;9H}[K[19;9Hvoid Write() const[20;9H{ Time :: Write(); // hh:mm:ss[21;9H string zoneString[] = {"EST", "CST", "MST", "PST",[22;17H "EDT", "CDT", "MDT", "PDT"};[K[23;17Hcout << " " << zoneString[zone];[K[24;9H}[K[25;1H};[K[26;1H [27;1Hint main()[28;1H{[K[29;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[30;9HExtTime x(13, 30, 0, EST);[K[31;9H[K[32;9H//Q: change x to 14:45:00 EST;[33;9Hx.Set(14, 45, 0, EST );[K[34;9H[K[36;9H// Q: Out[37;9Hx.Write(); // 14:45:00[18;1H[18;9Hvoid Write() const[19;9H{ Time :: Write(); // hh:mm:ss[20;9H string zoneString[] = {"EST", "CST", "MST", "PST",[21;17H "EDT", "CDT", "MDT", "PDT"};[K[22;17Hcout << " " << zoneString[zone];[K[23;9H}[K[24;1H};[K[25;1H [26;1Hint main()[27;1H{[K[28;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[29;9HExtTime x(13, 30, 0, EST);[K[30;9H[K[31;9H//Q: change x to 14:45:00 EST;[32;9Hx.Set(14, 45, 0, EST );[K[33;9H[K[35;9H// Q: Out[36;9Hx.Write(); // 14:45:00[37;9H[K[18;1H[18;9H{ Time :: Write(); // hh:mm:ss[19;9H string zoneString[] = {"EST", "CST", "MST", "PST",[20;17H "EDT", "CDT", "MDT", "PDT"};[K[21;17Hcout << " " << zoneString[zone];[K[22;9H}[K[23;1H};[K[24;1H [25;1Hint main()[26;1H{[K[27;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[28;9HExtTime x(13, 30, 0, EST);[K[29;9H[K[30;9H//Q: change x to 14:45:00 EST;[31;9Hx.Set(14, 45, 0, EST );[K[32;9H[K[34;9H// Q: Out[35;9Hx.Write(); // 14:45:00[36;9H[K[18;1H[18;9H string zoneString[] = {"EST", "CST", "MST", "PST",[19;17H "EDT", "CDT", "MDT", "PDT"};[K[20;17Hcout << " " << zoneString[zone];[K[21;9H}[K[22;1H};[K[23;1H [24;1Hint main()[25;1H{[K[26;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[27;9HExtTime x(13, 30, 0, EST);[K[28;9H[K[29;9H//Q: change x to 14:45:00 EST;[30;9Hx.Set(14, 45, 0, EST );[K[31;9H[K[33;9H// Q: Out[34;9Hx.Write(); // 14:45:00[35;9H[K[37;9Hcout << "\n\nDone.\n\n";[18;1H[18;17H "EDT", "CDT", "MDT", "PDT"};[K[19;17Hcout << " " << zoneString[zone];[K[20;9H}[K[21;1H};[K[22;1H [23;1Hint main()[24;1H{[K[25;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[26;9HExtTime x(13, 30, 0, EST);[K[27;9H[K[28;9H//Q: change x to 14:45:00 EST;[29;9Hx.Set(14, 45, 0, EST );[K[30;9H[K[32;9H// Q: Out[33;9Hx.Write(); // 14:45:00[34;9H[K[36;9Hcout << "\n\nDone.\n\n";[37;9Hreturn 0;[K[18;1H[18;17Hcout << " " << zoneString[zone];[K[19;9H}[K[20;1H};[K[21;1H [22;1Hint main()[23;1H{[K[24;1H // Q: Def. obj of ExtTime x with 13:30:00 EST?[25;9HExtTime x(13, 30, 0, EST);[K[26;9H[K[27;9H//Q: change x to 14:45:00 EST;[28;9Hx.Set(14, 45, 0, EST );[K[29;9H[K[31;9H// Q: Out[32;9Hx.Write(); // 14:45:00[33;9H[K[35;9Hcout << "\n\nDone.\n\n";[36;9Hreturn 0;[K[37;1H}[K[18;1H[18;9H}[K[19;1H};[K[20;1H [21;1Hint main()[22;1H{[K[23;1H