logo CodeStepByStep logo

DateOperators

Language/Type: C++ classes operator overloading
Related Links:

Assume that a class of objects named Date has been created.

member name description
Date(m, d) constructs a new date representing the given month and day
getDay() returns the day
getMonth() returns the month

Define the following overloaded operators to work with the Date class: <<

operator name description
<< writes a date to an output stream in a format such as "9/17"
== returns whether two dates are equal
!= returns whether two dates are unequal
Function: Write a C++ function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.