Advertisement
Guest User

Untitled

a guest
Oct 30th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #ifndef DATE_H
  2. #define DATE_H
  3.  
  4. class Date
  5. {
  6. friend ostream& operator<<(ostream&, const Date&);
  7. friend istream& operator>>(istream&, Date&);
  8.  
  9. private:
  10. int month; //1-12
  11. int day; //1-31 depending on month
  12. int year; //any year
  13.  
  14. //utility function to check if day is proper for month and year
  15. int checkDay(int) const;
  16.  
  17. public:
  18. Date(int = 1, int = 1, int = 1990);
  19. Date& setDate(int, int, int);
  20.  
  21. int getMonth() const;
  22. Date& setMonth(int);
  23.  
  24. int getDay() const;
  25. Date& setDay(int);
  26.  
  27. int getYear() const;
  28. Date& setYear(int);
  29.  
  30. // void operator= (const Date &a);
  31. };
  32.  
  33. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement