Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program. Julian day numbers (JDN) are used to provide a number for a day of the year so that calculations can be

Write a C++ program.

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 1600to 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

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago