Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Fill in the missing functions in dates.cpp to enable the program to compile and

ID: 3773825 • Letter: F

Question

Fill in the missing functions in dates.cpp to enable the program to compile and correctly find the number of days between two dates. You may not change main(), we will check to ensure it is exactly the same. You may assume that the start date entered is not after the end date.

Example 1 (user input is bolded):

Enter a start date: 1/20/2017

Enter an end date: 1/20/2021

The number of days between those two dates are: 1461

Example 2 (user input is bolded):

Enter a start date: 1/2/3

Enter an end date: 4/5/6

The number of days between those two dates are: 1189

Example 3 (user input is bolded):

Enter a start date: 1/1/1

Enter an end date: 1/1/11

The number of days between those two dates are: 3652

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Explanation / Answer

date start = date( month, day, year) means that you have to define a 'date' class/struct.

int duration = end - start means that you must implement a subtraction of two 'date' class/structs. Therefore you must it overload by a 'operator-' function.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote