6b ClassesSlides

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { if (hours < 10) cout << '0'; if cout cout << hours << ':'; if (minutes < 10) cout << '0'; if cout cout << minutes << ':'; if (seconds < 10) cout << '0'; if cout cout << seconds; return (hours < t.hours return t.hours || (hours == t.hours && minutes < t.minutes) || t.hours && t.minutes || (hours == t.hours && minutes == t.minutes || t.hours && t.minutes && seconds < t.seconds)); && t.seconds } Note how we use the second instance of the Note class, t, via "struct-style" reference to the private style" members. members. Applied Programming One of the unwritten preconditions to all the One functions other than Set() iis that, before a Set() s reference to any instance of this class can be made, a call to Set() iis required. This is Set() s because we have yet to provide a class constructor. constructor. } Applied Programming For TimeType, a constructor might set time to 0. For TimeType So add TimeType(); to the definition, a...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online