Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

date.h

By: darearkin on Mar 16th, 2013  |  syntax: None  |  size: 1.79 KB  |  views: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Date class definition; Member functions defined in Date.cpp
  2. #ifndef DATE_H
  3. #define DATE_H
  4.  
  5. class Date
  6. {
  7. public:
  8.    static const int monthsPerYear = 12; // number of months in a year
  9.    Date( int = 1, int = 1, int = 1900, Time = (0,0,0)); // default constructor
  10.  
  11.    void tick(); //increase second by one increment
  12.    void increaseADay(); //
  13.    void print() const; // print date in month/day/year format
  14.    ~Date(); // provided to confirm destruction order
  15. private:
  16.    int month; // 1-12 (January-December)
  17.    int day; // 1-31 based on month
  18.    int year; // any year
  19.    Time time; // time object
  20.  
  21.    // utility function to check if day is proper for month and year
  22.    int checkDay( int ) const;
  23. }; // end class Date
  24.  
  25. #endif
  26.  
  27. /**************************************************************************
  28.  * (C) Copyright 1992-2010 by Deitel & Associates, Inc. and               *
  29.  * Pearson Education, Inc. All Rights Reserved.                           *
  30.  *                                                                        *
  31.  * DISCLAIMER: The authors and publisher of this book have used their     *
  32.  * best efforts in preparing the book. These efforts include the          *
  33.  * development, research, and testing of the theories and programs        *
  34.  * to determine their effectiveness. The authors and publisher make       *
  35.  * no warranty of any kind, expressed or implied, with regard to these    *
  36.  * programs or to the documentation contained in these books. The authors *
  37.  * and publisher shall not be liable in any event for incidental or       *
  38.  * consequential damages in connection with, or arising out of, the       *
  39.  * furnishing, performance, or use of these programs.                     *
  40.  **************************************************************************/