Question: // I need help with this problem. it has to be done in c++ and strictly follow the instructions . 1) Design a class Date
// I need help with this problem. it has to be done in c++ and strictly follow the instructions .
1) Design a class Date:
Provide 3 instance variables (int) to store the month, the day number, and the year
Provide the following functions:
--Default constructor sets date to 1, 1, 1500
--Constructor with parameters if parameters are not valid, set like default constructor
--setDate if parameters are not valid, set like default constructor
--Accessors for each instance variable
--Mutators for each instance variable if parameter is not valid set like default constructor
--Return the next day
--Return the previous day
--Calculate and return the day by adding a number of days to the current day. Examples: if the
current day is Monday and we add 4 days, the day to return is Friday; if the current day is Tuesday
and we add 13 days, the day to return is Monday.
--Print a date in the form mm-dd-yyyy
--Print a date with the month as a string (ex: March 20, 2010)
isLeap test whether the year is a leap year
--Return the number of days in the month
--Return the number of days passed in the year from the current date
--Return the number of days remaining in the year from the current date
--Calculate a new date by adding a fixed number of days to the date
--Print the calendar for the particular month
(can print a calendar for any month starting January 1, 1500.
Note that the day for January 1 of the year 1500 was a Monday. To calculate the first day of the
month, you can add the appropriate number of days to Monday, January 1, 1500.)
For example, the calendar for September 2014 should be printed as:
September 2014
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
--Write a program to test your Date class thoroughly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
