This set the time print the time increment the time

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: at this type? this set the time print the time increment the time by a second compare two times for equality determine if one time comes before another W e are not saying how these requirements are to We be implemented – the user doesn't need to know. That's an abstract data type. Applied Programming Applied Programming Here is a suitable declaration. class TimeType class TimeType { public: void Set(int,int,int); void Set(int,int,int void Increment(); void Write() const; bool Equals(const TimeType&) const; bool IsBefore(const TimeType&) const; private: int hours, minutes, seconds; } Let's look in some detail. Applied Programming The functions Set(), Increment() and The Set() Increment() and Write() don't have an argument indicating what Write() don't we are setting, incrementing or writing. we How does the program know what data to How manipulate? manipulate? Because the name of the identifier precedes the Because function when it is used. function Let's create an instance of a TimeType. Let's TimeType TimeType now; This creates space for the data component of the This class – currently (and...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online