HW 2.1: Day of the Week rite a program that, when a given a target date (month, day year) is input, will display the day of the week for that date You waill implement the following algorithm 1 Calculate the day of the week for December 31 of the preceding year by using the follwing formula: 11 which factors in the count of leap years ((year-1),365 + 1(year _ 1)/41-1(year-1) , 100+1(year-1) , 400)%7 where the result has the following interpretation o 0 Sunday o 1: Monday o 2: Tuesday o 3: Wednesday o 4 Thursday o 5 Friday o 6 Saturday Now that you have the day for December 31 of the preceding year, you then calculate (and add to the previous result) the sum of the total number of days n each month preceding the target month Use a avitch statement having fall-through logic for this calculation Eg. if the target month is December the awitch statement will execute the top case which adds the number of days in November to the sum then it falls down to the next case which adds the number of days in October, and so on through January For a target month of January the awiteh statement would add no days For February, you will need to compute whether it has 28 or 29 days by adding one if the year is (divisible by 4 AND not by 100) OR the year is divisible by 400 To this sum, now add the target day of the month Thus number, modulo aeven, is the day of the week for the target date using the above encoding scheme For extra credit, use enun data types (see Gaddis, Section 11.11 133 12 in Sth ed) for the days of the week, each month the montha of the year, and the number of days in KCD xked leap year HW 2.1: Day of the Week rite a program that, when a given a target date (month, day year) is input, will display the day of the week for that date You waill implement the following algorithm 1 Calculate the day of the week for December 31 of the preceding year by using the follwing formula: 11 which factors in the count of leap years ((year-1),365 + 1(year _ 1)/41-1(year-1) , 100+1(year-1) , 400)%7 where the result has the following interpretation o 0 Sunday o 1: Monday o 2: Tuesday o 3: Wednesday o 4 Thursday o 5 Friday o 6 Saturday Now that you have the day for December 31 of the preceding year, you then calculate (and add to the previous result) the sum of the total number of days n each month preceding the target month Use a avitch statement having fall-through logic for this calculation Eg. if the target month is December the awitch statement will execute the top case which adds the number of days in November to the sum then it falls down to the next case which adds the number of days in October, and so on through January For a target month of January the awiteh statement would add no days For February, you will need to compute whether it has 28 or 29 days by adding one if the year is (divisible by 4 AND not by 100) OR the year is divisible by 400 To this sum, now add the target day of the month Thus number, modulo aeven, is the day of the week for the target date using the above encoding scheme For extra credit, use enun data types (see Gaddis, Section 11.11 133 12 in Sth ed) for the days of the week, each month the montha of the year, and the number of days in KCD xked leap year