Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Is everyone cut out to be a leader? Explain.

Answered: 1 week ago