Question: Write a C++ program that will accept three positive integer values: A month value between 1 and 12, a day value between 1 and 31,
Write a C++ program that will accept three positive integer values: A month value between 1 and 12, a day value between 1 and 31, and a 4-digit year value. Use these values to determine the Julian day of the specified year. To eliminate ambiguities with the MM/DD/YYYY format, ask the user to enter the three values as three separate integers, either separated by spaces on one line of input or prompt for the values with three separate line item prompts.
Design Requirements:
Your program must use the structure declaration below:
typedef struct { unsigned monthNo;
unsigned monthDays; } oneMonth;
Your program must also declare the following variable as a single dimension array:
oneMonth oneYear[12];
You will need to initialize the oneYear array so that oneYear[0].monthNo = 1, oneYear[0].monthDays = 31, and so on up through oneYear[11]. You may programmatically initialize this array or initialize it at time of declaring the oneYearvariable. Use your leap year user function from earlier assignments to determine if the year number entered by the user is a leap year and set the number of days inoneYear[1].monthDays accordingly.
Use the oneYear struct array along with the month, day and 4-digit year entered by the user to determine the associated 3-digit Julian day. Your program is to output to the console the following message with the information inside the [] either dynamically determined by your program or entered by the user, do not output the []s. Pad the Julian day with leading zeros as necessary so 3-digits are always output to the console:
[mm/dd/yyyy] is Julian day [jjj] Where the mm/dd/yyyy values are entered by the user and the jjj Julian day value is
dynamically determined by your program.
Your program must also loop back to allow for multiple inputs and accept a quit sentinel of your choice to terminate.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
