Question: Using C++ and Operator Overloading: You need to add C++ code into DateType.cpp to implement the enhanced version of the DateType class as described in
Using C++ and Operator Overloading:
You need to add C++ code into DateType.cpp to implement the enhanced version of the DateType class as described in DateType.h. Look at the code provided for DateType.h, DateType.cpp, and DateTest.cpp combine them using Operator Overloading
DateType.h, which specifies all the member functions and other information in the enhanced DateType class,
DateType.cpp, which provides the implementation of the enhanced DateType class, and
DateTest.cpp, which contains the main function for testing the implementation of the enhanced DateType class.
DateType.cpp:






DateType.h:


DateTest.cpp


![char fileName [50]; //Two DateType objects for testing //for file output //for](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66eec4d198ed4_98566eec4d13a4fe.jpg)


DateType.cpp rogram (Global Scope) #include #include #include "DateTy 4. int main() 8 10 // Setting the seed for the random function 12 srand (unsigned int)time NULL); 14 15 DateType datel, date2; ofstream fout; ifstream fin; char fileName [50]; //Two DateType objects for testing //for file output //for file input //for storing the file name 17 18 20 21 int ; //For storing integers bool inMenu = true; // while the user is using the program this var is set to true and the menu keeps looping 24 25 26 27 28 // when the user wants to quit, it is set to false and the loop ends char keyPressed; IIThis var stores which menu selection the user picks while inMenu) 30 cout date\ > date\" "> date\" "> keyPressed 56 57 58 59 60 :switch(keyPressed) f l case Q : case 'q'://Quit cout date2" date2) cout = overloaded operator test if (date1 >= date2) : cout - date2) is false " > i; cout > i; cout >datel" datel\" "> date1; cout datel\" above "> date\" where" > date1; cout > fileName ; :cout date121" to read the date back into date2" > date\" where" > date!; cout > fileName ; :cout date121" to read the date back into date2" date2; :fin.close) icout > date2\" above to read the date from the file: " 1 4 int main) 8 10 // Setting the seed for the random function srand (unsigned int)time NULL); DateType datel, date2; ofstream fout; ifstream fin; char fileName [50]; //Two DateType objects for testing //for file output //for file input //for storing the file name 17 18 20 21 int i; //For storing integers bool inMenu true; // while the user is using the program this var is set to true and the menu keeps looping // when the user wants to quit, it is set to false and the loop ends 25 26 27 28 char keyPressed; // This var stores which menu selection the user picks while inMenu) 30 cout> date\" "> keyPressed 56 57 58 59 60 :switch(keyPressed) f : case 'q'://Quit cout date2" overloaded operator test rogram 103 104 105 106 107 108 109 110 if (date1 date2) cout date2) is false"= overloaded operator test :if (datel -date2) : cout - date2) is false " 1; | | cout 1; | | cout > date\" " datel\" "> date1 ; icout > datel\" above "> date\" where" > date1 ; cout > fileName; :cout > date2\" above to read the date from the file: " 4. int main() 8 10 // Setting the seed for the random function 12 srand (unsigned int)time NULL); 14 15 DateType datel, date2; ofstream fout; ifstream fin; char fileName [50]; //Two DateType objects for testing //for file output //for file input //for storing the file name 17 18 20 21 int ; //For storing integers bool inMenu = true; // while the user is using the program this var is set to true and the menu keeps looping 24 25 26 27 28 // when the user wants to quit, it is set to false and the loop ends char keyPressed; IIThis var stores which menu selection the user picks while inMenu) 30 cout date\ > date\" "> date\" "> keyPressed 56 57 58 59 60 :switch(keyPressed) f l case Q : case 'q'://Quit cout date2" date2) cout = overloaded operator test if (date1 >= date2) : cout - date2) is false " > i; cout > i; cout >datel" datel\" "> date1; cout datel\" above "> date\" where" > date1; cout > fileName ; :cout date121" to read the date back into date2" > date\" where" > date!; cout > fileName ; :cout date121" to read the date back into date2" date2; :fin.close) icout > date2\" above to read the date from the file: " 1 4 int main) 8 10 // Setting the seed for the random function srand (unsigned int)time NULL); DateType datel, date2; ofstream fout; ifstream fin; char fileName [50]; //Two DateType objects for testing //for file output //for file input //for storing the file name 17 18 20 21 int i; //For storing integers bool inMenu true; // while the user is using the program this var is set to true and the menu keeps looping // when the user wants to quit, it is set to false and the loop ends 25 26 27 28 char keyPressed; // This var stores which menu selection the user picks while inMenu) 30 cout> date\" "> keyPressed 56 57 58 59 60 :switch(keyPressed) f : case 'q'://Quit cout date2" overloaded operator test rogram 103 104 105 106 107 108 109 110 if (date1 date2) cout date2) is false"= overloaded operator test :if (datel -date2) : cout - date2) is false " 1; | | cout 1; | | cout > date\" " datel\" "> date1 ; icout > datel\" above "> date\" where" > date1 ; cout > fileName; :cout > date2\" above to read the date from the file: "