Experiment with setting dates to valid values


Write a class called "Date" with month, day and year as the private members. Have a constructor which sets default date to 1st January 2000. Have an accessor function which retrieves each of the private data members. Also have mutator functions which set valid values for date as well as each of the private data members. For any invalid entry, set the date to the default value. Finally have a printDate() function which prints date in the following format: mm-dd-yyyy - pad with 0s wherever necessary.

In your client program have a function called "void IncrementMonth (Date &, int)"

Experiment with setting dates to valid values, invalid values and increment month to 6 months, 12 months and 15 months. Adjust the day and year accordingly. Print out the starting date before you make any increments. 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Experiment with setting dates to valid values
Reference No:- TGS0120135

Expected delivery within 24 Hours