Question
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
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