Feb 5 - }; Void Time::getHour(){ Return hour; } Void...

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

View Full Document Right Arrow Icon
Feb 5, 2006, ECE106 Overloaded Operators Class Time{ Private: Int hour, minute, second; Public: Time(); Time(int, int, int); ~Time(); Int getHour(); // Int getMinute(); //accessor functions/methods Int getSecond(); // Void setHour(int h); // Void setMinute(int m); //mutator functions/methods Void setSecond(int s); // Time operator+(Time t); Time operator–(Time t); Void print();
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: }; Void Time::getHour(){ Return hour; } Void Time::setMinute(int m){ Minute = m; } Time::Time(){ Hour = 0; Minute = 0; Second = 0; } Time::Time(int h, int m, int s){ //error checking Hour=h; Minute=m; Second=s; } Time x(0,12,5); Time y(1,5,10); Time z; Z=x.operator+(y); Z=x+y; Operator+ { Totalseconds=hour*3600+minute*60+second; }...
View Full Document

Page1 / 2

Feb 5 - }; Void Time::getHour(){ Return hour; } Void...

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