Question: how can i fix my program to output more than 7 days. here is what its suppsed to be and here is what I have


![the Week [20] Write a program that will calculate the day of](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a8e15a9d6_51266f3a8e0ef686.jpg)


Problem 2: Find the Day of the Week [20] Write a program that will calculate the day of the week for any date between September 4, 1752 and Dec 31, 2399. To find the day of the week you first must determine whether the year was a leap year. In general, if a year is evenly divisible by 4, it is a leap year. However, there are exceptions Century years, such as 1800 and 1900, are not leap years, despite the fact that they are divisible by 4. Furthermore, as an exception to the exception, a century year that is divisible by 400 (such as the year 2000) is a leap year. The algorithm for finding the day of the week requires several key numbers that can be obtained from the following tables. Month Key Jan 1 (0 if Leap Year Feb 4 (3 if Leap Year) Mar 4. Apr May Jun 3 Month Jul Aug Sep Oct Nov Dec 0 3 6 Day Key Sat 0 Sun 1 Mon 2 Century Kev 1700s 1800s 2 1900s 20005 6 21008 22005 2 23008 olc Tue 3 Wed 4 Thr 5 Fri 6 tico to 4 The algorithm works as follows: (We will use December 7, 1941, as an example) Step 1: obtain the following 5 numbers 1) The last two digits of the year 41 2) The number from step 1 divided by 4 (ignore remainder) 10 3) The month key (find from the table) 6 4) The day of the month 5) The century key (find from the table) 0 Step 2: add the five numbers 64 Step 3: divide the sun by and keep the rereainder 647-9 T! Step 4: Find the retninder in the day key table to find the day of the week Sample Output: Enter the day 1 - 31.): 7 Enter the month (1 - 12): 12 Enter the year 1752 - 2399) 1941 That day is Sunday. Required Test Cases: 5, 10, 1957 151200 15. 1. 2001 15) 1. 2004 p* X (Global Scope) W Include sect.cn #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
