Consider the following class Date, which represents a date using three ints for month, day and year:
class Date
{
private:
int month;
int day;
int year;
public:
Date() { month = day = year = 0; }
Date(int m, int d, int y) { month = m; day = d; year = y; }
bool operator==(Date);
bool operator<>
};
Write an implementation for both overloaded operators. == should return true if the Date objects are equivalent and false if not.< should="" return="" true="" if="" the="" date="" of="" the="" calling="" object="" (left="" object)="" comes="" before="" the="" parameter="" date="" object="" (right="" object)="" and="" false="" if="">
You may assume that all objects of class Date are valid, i.e. month is between 1 and 12, inclusive; day contains an appropriate day for the given month, and year can be anything.
You do not need to demonstrate calling these operators.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here