Question: Please write this C++ program, use else if statements if possible. I also believe there will also be cin and cout variables. Thank you!! Write

Please write this C++ program, use else if statements if possible. I also believe there will also be cin and cout variables. Thank you!!

Please write this C++ program, use else if statements if possible. I

Write a C++ program that, given a person's birth date (or any other date in the Gregorian calendar), will display the day of the week the person was born. To determine the day of the week, you will first need to calculate the day of the week for December 31 of the previous year. To calculate the day for December 31, use the following formula: ( 1 1-1m00 11+1"400 11) year - 1 year -1) x 365+ 96 7 The result of the formula is an integer in the range [0.6], where 0 is Sunday, 1 is Monday, 2 is Tuesday, and 6 is Saturday. Once you know the day for December 31, you simply calculate the days in the year before the month in question. Use a switch statement to make this calculation. (Hint: Use case 12 first, and then fall into case 11, 10, 2.) If the desired month is 12, add the number of days for November (30). If it is 11, add the number of days for October (31). If it is 3, add the number of days for February (28). If it is 2, add the number of days for January (31). If you do not use a break between the months, the switch will add the days in each month before the current month. To this figure, add the day in the current month and then add the result to the day code for December 31. This number modulo seven is the day of the week. There is one more refinement. If the current year is a leap year, and if the desired date is after February, you need to add 1 to the day code. The following formula can be used to determine if the year is a leap year. (Iyear 96 4) && (year 96 100))! ! (year % 400) Your program should prompt the user to enter a date in month, day, year order. Note the input format in the sample interaction below. If you detect input failure, print "Input failure." and return 1 from the main function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!