C++: Consider the definition of the class dateType given in Chapter 11. a) Write
ID: 3752810 • Letter: C
Question
C++: Consider the definition of the class dateType given in Chapter 11.
a) Write the statement that includes a friend function named before in the class dateType that takes as parameters two objects of type dateType and returns true if the date represented by the first object comes before the date represented by the second object; otherwise, the function returns false.
b) Write the definition of the function you defined in part a.
Here is the class that is given:
class dateType
{
public:
void setDate(int month, int day, int year);
int getDay() const;
int getMonth() const;
int getYear() const;
void printDate() const;
dateType(int month = 1, int day = 1, int year = 1900);
private:
int dMonth;
int dDay;
int dYear;
};
I am not good with friend functions so any help you could offer would be much apperciated.
Thank you in advance