Question: 4. Lab Exercise -- Overloading Part 1 1. Change the sameMonth function into a overloaded == operator. This will be a member function as demonstrated

 4. Lab Exercise -- Overloading Part 1 1. Change the sameMonth
function into a overloaded == operator. This will be a member function
as demonstrated in the notes. Remember that you will want to compare
the month, day, and year. 2. Add an overloaded ++ operator (as
a member function, shown in the notes) 3. Just for fun, change
the printDate function into an overloaded using namespace std; class Date {
private: int month; int day; int year; public: Date(); Date(int m, int

4. Lab Exercise -- Overloading Part 1 1. Change the sameMonth function into a overloaded == operator. This will be a member function as demonstrated in the notes. Remember that you will want to compare the month, day, and year. 2. Add an overloaded ++ operator (as a member function, shown in the notes) 3. Just for fun, change the printDate function into an overloaded using namespace std; class Date { private: int month; int day; int year; public: Date(); Date(int m, int d, int y); int endOfMonth() const; int getMonth() const; int getDay() const; int getYear() const; void setMonth(int m); void setDay (int d); void setYear(int y); void printDate() const; bool sameMonth(const Date& myDate) const; }; // Filename: main.cpp // Purpose: To practice using overloaded functions and operators #include "Date.h" #include using namespace std; int main() { Date date1; int month, day, year; cout > month >> day >> year; date 1.setMonth(month); date1.setDay(day); date 1.setYear(year); cout > month >> day >> year; //Calling constructor with three arguments Date date2(month, day, year); 1 /*-PART 1 Change this code to the comments indicated beside-*1 I */ date1.printDate(); //cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!