1) 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; }...


1) 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<>


};


It asks to create 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="">


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 don't need to demonstrate calling these operators.





Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here