Question: o Build a c++ class called myDate. It has the following operations: myDateO - this is the default constructor and will set the date to


o Build a c++ class called myDate. It has the following operations: myDateO - this is the default constructor and will set the date to May 11, 1955 myDateCint m, int d, int y) - this is the overloaded constructor and will set the date to the values passed in through the parameter list represented by month, day and year. void displayO - display the date in the following format: May 11, 1959. Please don't print a linefeed after the date. void incrementDate int n) - increment the date by n days void decrement(int n) -decrement the date by n days int daysBetween(myDate DATE) - return the number of days between this date and the date DATE. If date DATE is a future date, the return value will be a positive int. If date DATE is in the past, then the return value will be a negative int. int getMonthO - return the month in integer form int getDayO - return the day of the month int getYear -return the year int dayOfYearO -return the number of days since the current year began. Example: January 1 is 1, February 1 is 32 string dayNameO - return Monday, Tuesday, etcetera according to the day of the week. o Write a program that test each operation o You can never have a date that is invalid. The only opportunity for this to happen will be with the overloaded constructor. Therefore, if any invalid data is passed to this constructor, ignore all data and set the values to the default date. o Please use "pass by reference" for some of the function in the Julian date converter. o 2 functions that are not class members are provided: G23(int month, int day, int year) -pass in the month, day, year and return the Julian number. 32G(int JD, int& month, int& day, int& year) -pass in the Julian date, and get the correct month, day and year through the parameter list - pass by reference. o Locate these functions in the top portion of the myDate.cpp file. Both prototypes are provided
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
