Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Overloaded Operators Basic Date Class Create a new project named Assign08-OverloadedOperators. The driver program can be copied from OverloadedOperators-DateDriver.txt, and the Date class header file
Overloaded Operators Basic Date Class Create a new project named Assign08-OverloadedOperators. The driver program can be copied from OverloadedOperators-DateDriver.txt, and the Date class header file can be found in OverloadedOperators- DateHeader.txt. Both files are located in C:\VCProjectsoop. Add these six overloaded operators to the Date class Date.cpp implementation file: == != = along with the insertion and extraction operators >> and using namespace std; class Date friend istream& operator>>(istream&, Date&); loverloaded extraction operator zz friend to Date class friend ostream& operator(const Date&) const; /overloaded greater than operator bool operator=(const Date&) const; private: // private member functions and data members void setDefaultDate(); // set default date - 1/01/1970 int month; int day; O CAVCProjectsOOP\Assign08 Overloaded Operators\Debug\OperatorOverload int year; 12/31/2015 -- 12/31/2015 is TRUE 12/31/2015 - 12/31/2015 is FALSE Use the driver program to display the 1/01/2016 1/01/2016 is TRUE result of each comparison. 1/01/2016 - 1/01/2016 is FALSE Uncomment individual operators in the 12/31/2815 3/81/2017 is FALSE overloaded operator is completed within 3/03/2017 > 3/02/2017 is TRUE the Date.cpp module. 2/28/2017 = 1/01/2016 is TRUE Use the setfill(..) stream function, 3/01/2012 3/02/2017 is TRUE along with setw(2), to place a leading 12/31/2015 ( 1/01/2016 is TRUE space in front of month values less than 18/01/2017 > 3/03/2012 is 10 and a zero in front of day values less TRUE 1/31/2018 > 18/01/2012 is TRUE than 10. The year field needs 4 spaces. Dato streaning 10: The overloaded extraction operator >> 1/31/2018 allows direct input of month day year Inn dd yyyy -- Enter date using this format values into a cin input stream with space separators. Press any key to continue.. 18/01/2012 2/09/1996
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started