//***************************************************************** // IMPLEMENTATION FILE (Entry.cpp) // This file contains the specification of the Entry ADT, // which has two contained classes, Name and Time //***************************************************************** #include "Entry.h" #include #include string Entry::NameStr() const // Returns a string made up of first name, blank, last name // Postcondition: // Return value is first name of Name object, blank, and // last name of Name object { return (name.FirstName() + ' ' + name.LastName()); } string Entry::TimeStr() const // Returns a string made up of hour, colon, minutes // Post condition: // Return value is minutes from Time object, colon, and // seconds of Time object { string outStr = ""; ostringstream tempOut; // Access ostringstream if (time.Hours() < 10) outStr = outStr + '0'; outStr = outStr + time.Hours() << ":"; utStr if (time.Minutes() < 10) tempOut << '0'; tempOut << time.Minutes() << ":"; if (time.Seconds() < 10) tempOut << '0'; tempOut << time.Seconds(); outStr = tempOut.str(); return outStr; } Entry::Entry() // Default constructor // Postcondition: // Entry object has been constructed { } Entry::Entry( /* in */ string firstName, /* in */ string middleName, /* in */ string lastName, /* in */ int initHours, /* in */ int initMinutes, /* in */ int initSeconds ) // Constructor initializers : name(firstName, middleName, lastName), time(initHours, initMinutes, initSeconds) // Parameterized constructor // Postcondtion: // Entry object has been constructed with firstName, // middleName, and lastName as arguments to Name // parameterized constructor; initHours, initMinutes, // and initSeconds as arguments to Time paraeterized // constructor { }