Kanjut SHELL
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  ]

Current File : /home/kmmowery/cs212/vector2
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";cout << "B      To delete the last word.\n";cout << "R      Reverse the order.\n";cout << "S      Sort to ascending order.\n";cout << "D      To sort in the list.\n";cout << "Q      Quit.\n";cout << "*************************************************\n\n";cout << "Your choice: ";}  .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; s.\n";o.\n";r.\n";t.\n"; .\n";t.\n";h.\n";e.\n"; .\n";.\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; .\n"; S.\n";o.\n";r.\n";t.\n"; .\n";t.\n";o.\n"; .\n";d.\n";e.\n";s.\n";c.\n";e.\n";n.\n";d.\n";i.\n";n.\n";g.\n"; .\n";o.\n";r.\n";d.\n";e.\n";r.\n";                       Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          vector2.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 94 lines ][kmmowery@zeus cs212]$ pico vector2.cpp./a.outpico vector2.cppscript vector2
Script started, file is vector2
[kmmowery@zeus cs212]$ ,.q
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 pico vector2.cppcd cs212pico vector2.cppcd cs212 pico vector2.cpp./a.outpico vector2.cppscript vector2g++ vector2.cpp
[kmmowery@zeus cs212]$ scriptt 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]$ vipico vector2.cpptime2cp time2.cpp pico time2.cpp
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ New file ]File: time2.cppModified////...////File:time2.cpp//Compile:g++time1.cpp-otime1.out//Run:./time.out//Goal:OOPinheritance-Time,ExtTime,...//#include<iostream>usingnamespacestd;classTime{inthrs,mins,secs;public://constructorsTime()//0:0:0{hrs=0;mins=secs=0;}Time(inth,intm,ints){hrs=h;mins=m;secs=s;}voidSet(inth,intm,ints){hrs=h;mins=m;secs=s;}//observersvoidWrite()const//hh:mm:ss{cout<<hrs<<":"<<mins<<":"<<secs;}voidIncrement(){secs++;}boolEqual(Timex)const{if(hrs==x.hrs&&mins==x.mins&&secs==x.secs)returntrue;elsereturnfalse;}};        {       hrs = 0; mins = secs = 0;      }        Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }         // observers        void Write() const      // hh:mm:ss        {       cout << hrs << ":" << mins << ":" << secs;      }void Increment()        {       secs ++;        }bool Equal( Time x) const        {       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;                else    return false;        }};   //p.159enumZoneType{EST,CST,MST,PST,EDT,CDT,MDT,PDT};//defineanewclass-subclassExtTimefromsuperclassTimeclassExtTime:publicTime{ZoneTypezone;//extradatamemberpublic:ExtTime()//0:0:0EST{zone=EST;}ExtTime(inth,intm,ints,ZoneTypez):Time(h,m,s){zone=z;}//p.162voidSet(inth,intm,ints,ZoneTypez){Time::Set(h,m,s);zone=z;}voidWrite()constenum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() const {Time::Write();//hh:mm:ssstringzoneString[]={"EST","CST","MST","PST","EDT","CDT","MDT","PDT"};cout<<""<<zoneString[zone];}};intmain(){//Q:Def.objofExtTimexwith13:30:00EST?ExtTimex(13,30,0,EST);//Q:Outx.Write();cout<<"\n\nDone.\n\n";return0;                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;    }                       Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          time2.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 74 lines ][kmmowery@zeus cs212]$ pico time2.cppscript vector2pico time2.cppcp time2 > time3.
cp: missing destination file
Try `cp --help' for more information.
[kmmowery@zeus cs212]$ cp time2 > time3pico time2.cpp
[kmmowery@zeus cs212]$ pico time2.cpp3.cpp
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ New file ]File: time3.cppModified////...////File:time2.cpp//Compile:g++time1.cpp-otime1.out//Run:./time.out//Goal:OOPinheritance-Time,ExtTime,...//#include<iostream>usingnamespacestd;classTime{inthrs,mins,secs;public://constructorsTime()//0:0:0{hrs=0;mins=secs=0;}Time(inth,intm,ints){hrs=h;mins=m;secs=s;}voidSet(inth,intm,ints){hrs=h;mins=m;secs=s;}//observersvoidWrite()const//hh:mm:ss{cout<<hrs<<":"<<mins<<":"<<secs;}voidIncrement(){secs++;}boolEqual(Timex)const{if(hrs==x.hrs&&mins==x.mins&&secs==x.secs)returntrue;elsereturnfalse;}};        {       hrs = 0; mins = secs = 0;      }        Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }         // observers        void Write() const      // hh:mm:ss        {       cout << hrs << ":" << mins << ":" << secs;      }void Increment()        {       secs ++;        }bool Equal( Time x) const        {       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;                else    return false;        }};   //p.159enumZoneType{EST,CST,MST,PST,EDT,CDT,MDT,PDT};//defineanewclass-subclassExtTimefromsuperclassTimeclassExtTime:publicTime{ZoneTypezone;//extradatamemberpublic:ExtTime()//0:0:0EST{zone=EST;}ExtTime(inth,intm,ints,ZoneTypez):Time(h,m,s){zone=z;}//p.162voidSet(inth,intm,ints,ZoneTypez){Time::Set(h,m,s);zone=z;}voidWrite()constenum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() const {Time::Write();//hh:mm:ssstringzoneString[]={"EST","CST","MST","PST","EDT","CDT","MDT","PDT"};cout<<""<<zoneString[zone];}};intmain(){//Q:Def.objofExtTimexwith13:30:00EST?ExtTimex(13,30,0,EST);//Q:Outx.Write();cout<<"\n\nDone.\n\n";return0;                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;    }enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }p.162 void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const        {       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);// Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;        {       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        // observersvoid Write() const      // hh:mm:sscout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;        else    return false}};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }p.162 void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const////      ...////      File:           time2.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           OOP inheritance - Time, ExtTime, ...//#include <iostream>using namespace std;class Time{       int hrs, mins, secs;public:// constructors        Time()          // 0:0:0        {       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        // observersvoid Write() const      // hh:mm:sscout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;        else    return false}};.cpp 3.cpp        {       hrs = 0; mins = secs = 0;      }        Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }         // observers        void Write() const      // hh:mm:ss        {       cout << hrs << ":" << mins << ":" << secs;      }void Increment()        {       secs ++;        }bool Equal( Time x) const        {       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;                else    return false;        }};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() constenum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() const        {       Time :: Write();        // hh:mm:ss                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;}    // Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}\ // Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}// Q: Outx.Write();cout << "\n\nDone.\n\n";return 0;} // Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}//Q:changextio  o23:  4:45:00;// Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}ExtTimex(         set.x    x  x.set(    Set(2 ()  );// Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}1);4);:);2);4);:);0);0);4:45:00; 14:45:00;00); ,00);24,00); ,24,00); 24,00);,00); ,00); 4,00);5,00););  );,); );); ); ); );  );,); );); ); 0);,); ); ;E;S;T; );E );S );T );, ); ); // Q: Out x.Write();cout << "\n\nDone.\n\n";        return 0;}//Q://14:45:00// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}                        Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          time3.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 78 lines ][kmmowery@zeus cs212]$ pico time3.cppcp time2 > time3pico time3.cppg
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.cpppico time3.cpp
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ Reading file ][ Read 78 lines ]File: time3.cpp////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           OOP inheritance - Time, ExtTime, ...//#include <iostream>using namespace std;class Time{       int hrs, mins, secs;public:// constructorsTime()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;else    return false;}};        {       hrs = 0; mins = secs = 0;      }        Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }         // observers        void Write() const      // hh:mm:ss        {       cout << hrs << ":" << mins << ":" << secs;      }void Increment()        {       secs ++;        }bool Equal( Time x) const        {       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;                else    return false;        }};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() constenum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() const        {       Time :: Write();        // hh:mm:ss                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00Modified0, EST );                       Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          time3.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 78 lines ][kmmowery@zeus cs212]$ pico time3.cpp./a.outg++ time3.cpp
[kmmowery@zeus cs212]$ g++ time3.cpppico time3.cpp./a.out
14:45:0 EST

Done.

[kmmowery@zeus cs212]$ ./a.outg++ time3.cpppico time3.cpp
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ Reading file ][ Read 78 lines ]File: time3.cpp////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           OOP inheritance - Time, ExtTime, ...//#include <iostream>using namespace std;class Time{       int hrs, mins, secs;public:// constructorsTime()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;else    return false;}};        {       hrs = 0; mins = secs = 0;      }        Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }         // observers        void Write() const      // hh:mm:ss        {       cout << hrs << ":" << mins << ":" << secs;      }void Increment()        {       secs ++;        }bool Equal( Time x) const        {       if(hrs==x.hrs && mins==x.mins && secs==x.secs)return true;                else    return false;        }};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() constenum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 ESTzone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s)        zone = z;        }void Write() const        {       Time :: Write();        // hh:mm:ss                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 00, EST );// Q: Outx.Write();              // 14:45:00Modified, EST );         {       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        // observersvoid Write() const      // hh:mm:sscout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;        else    return false}};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       } p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           OOP inheritance - Time, ExtTime, ...//#include <iostream>using namespace std;class Time{       int hrs, mins, secs;public:// constructors        Time()          // 0:0:0        {       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        void Set(int h, int m, int s)        {       hrs = h; mins = m; secs = s;    }        // observersvoid Write() const      // hh:mm:sscout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;        else    return false}};#include<         #include"time.h"; {       int hrs, mins, secs;public:        // constructorsTime()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159public:        // constructorsTime()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};        // constructorsTime()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};Time()          // 0:0:0{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Time{       hrs = 0; mins = secs = 0;      }Time(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public TimeTime(int h, int m, int s){       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data member{       hrs = h; mins = m; secs = s;    }void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:void Set(int h, int m, int s){       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       hrs = h; mins = m; secs = s;    }// observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   // observersvoid Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z)void Write() const      // hh:mm:ss{       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       cout << hrs << ":" << mins << ":" << secs;      }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }void Increment(){       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162{       secs ++;        }bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z)bool Equal( Time x) const{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);{       if(hrs==x.hrs && mins==x.mins && secs==x.secs)                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;                return true;else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}else    return false;}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const}};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss};  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",  // p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];                       Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          time3.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 56 lines ][kmmowery@zeus cs212]$ pico time3.cpp./a.outpico time3.cpp./a.outg++ 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
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ Reading file ][ Read 56 lines ]File: time3.cpp////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           OOP inheritance - Time, ExtTime, ...//#include <iostream>#include "time.h"using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 EST{       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];Modified  #include <iostream>"time.h"  using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}//  //<iostream>#include "time.h"   using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 EST{       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};        cout << " " << zoneString[zone];GOA  oal:usingtheuser-defibedh    nedheadertime.htocompile                       Y Yes                                                                                                              C Cancel              N No                                                                                                               Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?                                                                                  YesFile Name to write :                                                                                                                          time3.cpp^G Get Help            ^T  To Files                                                                                                       TAB Complete                                                                                                       [ Writing... ][ Wrote 56 lines ][kmmowery@zeus cs212]$ pico time3.cppg++ time3.cpp
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
   UW PICO(tm) 4.2                                               New Buffer                                                                   ^G Get Help            ^O WriteOut            ^R Read File           ^Y Prev Pg             ^K Cut Text            ^C Cur Pos             ^X Exit                ^J Justify             ^W Where is            ^V Next Pg             ^U UnCut Text          ^T To Spell            [ Reading file ][ Read 56 lines ]File: time3.cpp////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           using the user-defined header time.h to compile//#include <iostream>#include "time.h"using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 EST{       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];Modifiedusing namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 EST{       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};#include< "exittime.h"using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:ExtTime()       // 0:0:0 EST{       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",ttime.h" define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }         ExtTime(int h, int m, int s, ZoneType z)        : Time (h, m, s){       zone = z;       }        // p.162           void Set(int h, int m, int s, ZoneType z)        {       Time :: Set(h, m, s);zone = z;        }void Write() const        {       Time :: Write();        // hh:mm:ss                string zoneString[] = {"EST", "CST", "MST", "PST","EDT", "CDT", "MDT", "PDT"};                cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00//      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           using the user-defined header time.h to compile//#include <iostream>#include "time.h"#include "exttime.h"using namespace std;// p.159enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       } p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",enum ZoneType {EST, CST, MST, PST, EDT, CDT, MDT, PDT};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];// define a new class - subclass ExtTime from superclass Timeclass ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}class ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};        ExtTime()       // 0:0:0 EST        {       zone = EST;     }        ExtTime(int h, int m, int s, ZoneType z)        : Time (h, m, s)        {       zone = z;       }        // p.162        void Set(int h, int m, int s, ZoneType z)        {       Time :: Set(h, m, s);zone = z;        }        void Write() const        {       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}  int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}            ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       } p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                        "EDT", "CDT", "MDT", "PDT"};        cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           using the user-defined header time.h to compile//#include <iostream>#include "time.h"#include "exttime.h"using namespace std;class ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       } p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                        "EDT", "CDT", "MDT", "PDT"};        cout << " " << zoneString[zone];        }};        ExtTime()       // 0:0:0 EST        {       zone = EST;     }        ExtTime(int h, int m, int s, ZoneType z)        : Time (h, m, s)        {       zone = z;       }        // p.162        void Set(int h, int m, int s, ZoneType z)        {       Time :: Set(h, m, s);zone = z;        }        void Write() const        {       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];        }};int main(){// Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}  ////      ...////      File:           time3.cpp//      Compile:        g++ time1.cpp -o time1.out//      Run:            ./time.out//      Goal:           using the user-defined header time.h to compile//#include <iostream>#include "time.h"#include "exttime.h"using namespace std;class ExtTime : public Time{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST        {       zone = EST;     }ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       } p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);zone = z;}void Write() const{       Time :: Write();        // hh:mm:ssstring zoneString[] = {"EST", "CST", "MST", "PST",                        "EDT", "CDT", "MDT", "PDT"};        cout << " " << zoneString[zone];        }};{       ZoneType zone;  // extra data memberpublic:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  public:        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main()        ExtTime()       // 0:0:0 EST{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){{       zone = EST;     }   ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime(int h, int m, int s, ZoneType z): Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);: Time (h, m, s){       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);{       zone = z;       }// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;// p.162void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );void Set(int h, int m, int s, ZoneType z){       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );{       Time :: Set(h, m, s);        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );        zone = z;}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Out}void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00void Write() const{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00{       Time :: Write();        // hh:mm:ss        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00        string zoneString[] = {"EST", "CST", "MST", "PST",                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";                "EDT", "CDT", "MDT", "PDT"};cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;cout << " " << zoneString[zone];}};  int main(){        // Q: Def. obj of ExtTime x with 13:30:00 EST?ExtTime x(13, 30, 0, EST);//Q: change x to 14:45:00 EST;x.Set(14, 45, 0, EST );// Q: Outx.Write();              // 14:45:00cout << "\n\nDone.\n\n";return 0;}}};  int main(){ 

Stv3n404 - 2023