Question: Can you help me with these code. I need code for Date.cpp I got some codes here already for you: Date.h #pragma once #include using

Can you help me with these code. I need code for Date.cpp

Can you help me with these code. I need code for Date.cpp

I got some codes here already for you:

Date.h

#pragma once

#include

using namespace std;

class Date

{

friend istream& operator>>(istream&, Date&); // overloaded extraction operator - friend to Date class

friend ostream& operator

public: // public member functions

Date(); // default constructor (no parameters)

Date(int m, int d, int y); // constructor with month day year parameters

void setDate(int mm, int dd, int yyyy);

void displayDate() const;

bool operator==(const Date&) const; // overloaded equals operator ==

bool operator!=(const Date&) const; // overloaded not equal operator !=

bool operator

bool operator>(const Date&) const; // overloaded greater than operator >

bool operator

bool operator>=(const Date&) const; // overloaded greater than or equal operator =>

private: // private member functions and data members

void setDefaultDate(); // set default date - 1/01/1970

int month;

int day;

int year;

};

Assign08-OverloadedOperators

// Assign08OverloadedOperators.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include

#include

#include

#include "Date.h"

using namespace std;

void display(Date first, string op, Date second);

string compareDate(const Date& left, string op, const Date& right);

int main()

{

Date date01(12, 31, 2015);

Date date02(1, 1, 2016);

Date date03(2, 28, 2017);

Date date04(3, 1, 2017);

Date date05(3, 2, 2017);

Date date06(3, 3, 2017);

Date date07(10, 1, 2017);

Date date08(1, 31, 2018);

Date date09;

Date date10;

date09 = date01;

date10 = date02;

cout

display(date01, "==", date09);

display(date01, "!=", date09);

display(date02, "==", date10);

display(date02, "!=", date10);

cout

display(date01, "

display(date05, "

display(date03, ">", date04);

display(date06, ">", date05);

cout

display(date03, "

display(date05, ">=", date06);

display(date01, "

display(date02, ">=", date10);

cout

display(date04, "

display(date01, "

display(date07, ">", date06); // difference in minutes (same hour)

display(date08, ">", date07); // difference in hours

cout

cout

cout

cout

cout

cout

cin >> date10;

cout

cout

system("pause");

return 0;

}

void display(Date first, string op, Date second)

{

first.displayDate();

cout

second.displayDate();

cout

}

string compareDate(const Date& left, string op, const Date& right)

{

bool outcome = false;

if (op == "==")

outcome = (left == right);

else if (op == "!=")

outcome = (left != right);

else if (op == "

outcome = (left

else if (op == ">")

outcome = (left > right);

else if (op == "

outcome = (left

else if (op == ">=")

outcome = (left >= right);

if (outcome)

return "TRUE";

else

return "FALSE";

}

CSIS 223 C+ Object-Oriented Programming Assign08 OverloadedOperators Overloaded Operators - Basic Date Class te a new project named Assign08-OverloadedOperators. The driver program can be copied from Create a new proj rators-DateDriver.txt, and the Date class header file can be found in OverloadedOperators- Dateffeader.txt. Both files are located in C:\VCProjectsoop x overloaded operators to the Date class Date.cpp implementation file: -= >)s >> and using namespace std; class Date friend istream& operator (istream&, Date&); friend ostream operator(const Date&) const; #overloaded greater than operator bool operator 3/2 /2 17 is TRUE verloaded operator is completed within the Date.cpp module. 2/28/2R173 81281 TRUE is FALSE is 3/82/2 17 ): 33 /2017 e overloaded insertion operator 3/03/2017 is THUE Date, otreaing 10 overloaded extraction operator> 1312IH allows direct input of month day year values into a cin input stream with space separators. ad vy)Enter date using this fornat 21996 ress any hey Ln cont inue

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!