// File: Year.h // Simple class for Year; days count improved // Prepared by Dr. Spiegel #ifndef _YEAR #define _YEAR /*! * Class Year is a misnamed class that holds a complete date * and permits several operations on it, most notably the ability to * find how many days elapsed in that year * * */ class Year { public: /*! * Default Constructor: Do nothing * */ Year(); /*! * Constructor: Mutator: Set the date components * \param monthVal month * \param dayVal day * \param yearval year * */ Year(int monthVal,int dayVal,int yearVal); /*! * Static, as the value is the same for all * non-leap years * \return Days in a non-leap year * */ static int getDaysInYear(); /*! * Facilitator: Determine days elapsed from data members * \return Days elapsed in year * */ virtual int daysElapsed(); /*! * Facilitator - static; same for all non-leap years * \return day as percent of year * */ static double percentOfYear(int daysElapsed); /*! * Determine if a year is a leap year * Static, so it must take the year as an argument (Why??) * \return whether leap year * */ static bool isLeapYear(int Year); protected: int month,day,year; static int daysInYear; }; #endif