Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Julian day numbers (JDN) are used to provide a number for a day of the year so that calculations can be performed relatively easily to

Julian day numbers (JDN) are used to provide a number for a day of the year so that calculations can be performed relatively easily to determine the difference between two dates. The JDN for a day is the number of days that have elapsed between that day and a base date of January 1, 4713 BC. Use the following calculation: JDN = (1461 (Y + 4800 + (M 14) / 12)) / 4 + (367 (M 2 12 ((M 14) / 12))) / 12 (3 ((Y + 4900 + (M - 14) / 12) / 100)) / 4 + D 32075

Once the above is calculated, input two dates, convert them to their JDNs, and take the difference of the JDNs. Write a C++ program to find the difference between two dates using the method above. Error check dates- where day is an integer from 1 to 31, month goes from 1 to 12, and year goes from 1600 to 2100. Finally, ask the user to run again. A user-defined function must be used with the calculation. Refer to the sample output below.

Sample Run:

Enter the first date (MM/DD/YYYY): 9 7 1980

Enter the second date (MM/DD/YYYY): 6 11 2012

Days between dates 09/07/1980 and 06/11/2012 is: 11600

Run Again (Y/N)? n

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions