Zebra0.com

MCC++ Programming Project: Modify the Date Class

C++ Programming Project: Modify the Date Class

The Date Class

Using the date class, make the following modifications:
  1. Make a thanksgiving method for the Date class. It will receive the current year and returns the date for Thanksgiving.
  2. In the Date class there are only a few overloaded operators for comparison. Add all of the following: <=, >=, and !=
  3. Add a method to return the season as an integer: 0=winter, 1=spring, 2=summer and 3=fall for the northern hemisphere.
  4. Your main program should illustrate the use of each method.

You may use March 20th for the first day of Spring. Use June 20th for the first day of summer, September 22 for the first day of fall, and December 21 as the first day of winter. You will find the overloaded operators handy for this.
A nice solution for this is to use an array to store the first date for each season, then loop to see where a date falls.


This web site, and all pages therein, are the sole property and responsibility of Zebra0.com.
It is not endorsed, sponsored, or provided by or on behalf of Montgomery College.