I am trying to write a program which will derive one class from another class by adding a data member to store the time zone. Below is what I have so far. However I am unsure on how to write the function to set the time zone. could someone please help?
class extClockType: public clockType
{
public:
int getTimeZone();
void setTimeZone();
void printTime() const;
extClockType();
extClockType(int hours, int minutes, int seconds, int t);
private:
int timeZone;
};
int extClockType::getTimeZone()
{
return timeZone;
}
void extClockType::setTimeZone()
{
}
void extClockType::printTime() const
{
clockType::printTime();
cout << "The timezone is: " << timeZone << endl;
}
extClockType::extClockType()
{
timeZone = 0;
}
extClockType::extClockType(int hours, int minutes, int seconds, int t): clockType(hours, minutes, seconds)
{
timeZone = t;
}