Question
Is my answer correct to this question : 1) operator < is very important because it will help us determine if a date comes before
Is my answer correct to this question
: 1) operator < is very important because it will help us determine if a date comes before the other date.
prototype:
------------
bool operator<(Date &other);
// This returns a bool, true if this Date comes before 'other' Date.
2) operator - is very important because it will help us determine if the difference between two date.(How many days have passed between two dates)
prototype:
------------
int operator-(Date &other);
// This returns a int, indicating how many days have passed between two Dates.
implement a class Date. Describe Two operators you consider would make sense to overload. Explain the meaning of those operators, i.e. if you decide to overload the * operator, what does d1 * d2 mean? (provided d1 and d2 are instances of class Date). Show the function prototype of the two operators you decided to overload either as friend functions or member functions.
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