Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding language is C++ Write a program to accept any two dates in the form of month day year (8 23 2000), separated by spaces,

Coding language is C++

Write a program to accept any two dates in the form of month day year (8 23 2000), separated by spaces, and calculate the total number of days that has elapsed between the two dates, inclusive of the beginning and ending days. Remember that leap year is a year divisible by 4, except for centennial years, which must be divisible by 400, such as 1600 or 2000 (1800 is not a leap year). You can test your program with any typed in dates (or dates stored in a file) but it must finally run with the data shown below set up in a file. Print the output (dates and total days) on the screen. You must read in the following data from a file.

Be sure to show the original dates and the days between the dates on your output.

DATA: ANSWERS:

7 4 1776 1 1 1987 (76882)

2 1 1983 3 15 1984 (409)

7 7 1983 11 4 1983 (121)

7 3 1983 7 20 1983 (18)

12 25 1990 12 31 1992 (738)

Program must continue running until all the data is processed use a loop 1 to 6 or a while (month != -1) or while (!fin.eof()) - choose your own end of data technique. Read the data from a defined data file do not type in the data when the program runs.

Use if statements, switch statements, loops and functions to solve this problem. Do not use the Gregorian date method!

Your program must include at least four functions, not including the main method.

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

What steps are involved in the criminal litigation process?

Answered: 1 week ago

Question

Explain why the void increases faster than the quality in BWR

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago