//-------------------------------------------------------------------- // // Laboratory 1 logbook.h // // Class declaration for the Logbook ADT // //-------------------------------------------------------------------- class Logbook { public: // Constructor Logbook ( int month, int year ); // Create a logbook // Logbook marking operations void putEntry ( int day, int value ); // Store entry for day int getEntry ( int day ) const; // Return entry for day // General operations int month () const; // Return the month int year () const; // Return the year int daysInMonth () const; // Number of days in month // In-lab operations void displayCalendar () const; // Display as calendar Logbook (); // Default constructor void putEntry ( int value ); // Store entry for today int operator [] ( int day ) const; // Return entry for day void operator += ( const Logbook &rightLogbook ); // Combine logbooks private: // Facilitator (helper) function int leapYear () const; // Leap year? // In-lab facilitator function int dayOfWeek ( int day ) const; // Return day of the week // Data members int logMonth, // Month covered by logbook logYear, entry [31]; // Logbook entries };