Your instructor provides you with a class the definition file for a class called 'date' for which you have to write the implementation. In addition to the methods already provided in 'date.h', you are required to create member function that will compare two dates in order to find out if one is greater than, less than or equal to the other. The function should be called compareTo with the following signature:
int compareTo(date& otherDate) const;
The purpose of this function is to compare one date to another and return 1 if the otherDate is greater than the date being compared, 0 if they are equal, and -1 if the otherDate is less than the one being compared to.
Below you will find the functionality to some of the functions in your new class:
print() // display the date in the format MM/DD/YYYY
numberOfDaysPassed() // return the number of days passed in the year.
numberOfDaysLeft() // return the number of days left in the year.
incrementDate(int nDays) // increment the date by nDays.
isLeapYear() // return true if the year is leap otherwise returns false.
Create a program to test your new data type then using composition, create another class called 'person' to demonstrate your understanding of composition.