extClockType - else cout <<...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include "extClockType.h" # using namespace std; u void extClockType::setTime(int zone, int hours, int minutes, int seconds) { clockType::setTime(hours, minutes, seconds); zone_num = zone; else cout << "In setTime(): Invalid time zone. Time zone should be a number from -12 to 12." << endl; } { clockType::getTime(hours, minutes, seconds); zone = zone_num; } { zone = zone_num; } void extClockType::printTime() const { clockType::printTime(); cout <<" UTC" <<zone_num << endl; cout <<" UTC+" <<zone_num << endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else cout &lt;&lt; &quot;In printTime(): Invalid time zone. Time zone should be a number from -12 to 12. Exit.&quot;&lt;&lt; endl; } bool extClockType::equalTime(extClockType&amp; otherClock) { int hours, other_hours; int mins, other_mins; int secs, other_secs; int zone, other_zone; getTime(zone, hours, mins, secs); otherClock.getTime(other_zone, other_hours, other_mins, other_secs); return(zone == other_zone &amp;&amp; hours == other_hours &amp;&amp; mins == other_mins &amp;&amp; secs == other_secs); } extClockType::extClockType(int zone,int hours, int minutes, int seconds) { setTime(zone,hours, minutes, seconds); } extClockType::extClockType() //default constructor { setTime(0, 0, 0, 0); }...
View Full Document

Page1 / 2

extClockType - else cout &amp;amp;lt;&amp;amp;lt;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online