#include "stopWatchClock.h" stopWatch::stopWatch () { reset(); } stopWatch::~stopWatch() { } int stopWatch::getSec () { return sec; } int stopWatch::getMin () { return min; } int stopWatch::getHour () { return hour; } void stopWatch::incSec () { if (sec >= 59) { sec = 0; incMin(); } else { sec++; } } void stopWatch::incMin () { if (min >= 59) { min = 0; incHour(); } else { min++; } } void stopWatch::incHour () { if (hour >= 23) { overflow = true; hour = 0; } else { hour++; } } bool stopWatch::isOverflowSet () { return overflow; } void stopWatch::reset () { hour = 0; min = 0; sec = 0; overflow = false; } void stopWatch::setTime (int hour, int min, int sec) { this->sec = sec; this->min = min; this->hour = hour; }