Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

given lab09.cpp file in C++, lab09.cpp file: #include #include #include using namespace std; class clockType { public: void setTime(int,int,int); void getTime(int&,int&,int&)const; void printTime()const; void setH(int);

given "lab09.cpp" file in C++,

image text in transcribed

lab09.cpp file: #include #include  #include using namespace std; class clockType { public: void setTime(int,int,int); void getTime(int&,int&,int&)const; void printTime()const; void setH(int); void setM(int); void setS(int); int getH()const; int getM()const; int getS()const; void incrementSeconds(); void incrementMinutes(); void incrementHours(); bool equalTime(const clockType& other) const; private: int hr; int min; int sec; }; //------------------------ clockType class function implementation void clockType::setTime(int i, int j, int k){ hr = i; min = j; sec = k; } void clockType::setH(int h){ hr = h; } void clockType::setM(int m){ min = m; } void clockType::setS(int s){ sec = s; } void clockType::getTime(int& i, int& j, int& k)const{ i = hr; j = min; k = sec; } int clockType::getH() const{ return hr; } int clockType::getM() const{ return min; } int clockType::getS() const{ return sec; } void clockType::printTime() const{ cout  

Question: First, Download lab09.cpp. In this file, the definition of the class clockType has given. Think of the class clockType as the base class. Derive the class extClockType from the class clockType, by adding a class member variable to store the time zone (int tz) and necessary class member functions to make the class functional. Finally, use the driver program to test your classes Hint: Extending the timezone is only one modification required by the extClockType derived class. Further modifications include: Override printTime) function to include the timezone in the output as given output format Overload setTime ) function to accept the timezone in the parameter list .Add the incrementTimeZones function to add 1 hour to the current time zone You must not change the code in the driver program, and you should get the same output Output: ollowing are outputs from the base class clockType! he time is: 10 :23:11 The time is: 2: 23 12 ollowing are outputs from the derived class extclockType! he time is: 11:12: 13 Time Zone: 16 he time is: 14 1516 Time Zone: 20 The time is: 12:12 13 Time Zone: 11 The time is: 15 :15:16 Tine Zone: 21 ress any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions