Question: (use programing language)Exercise 1: Day of the week Write a function that receives as input a date expressed as d (day) m (month) a (year),

(use programing language)Exercise 1: Day of the week Write a function that receives as input a date expressed as d (day) m (month) a (year), and returns the day of the week. For instance, if the date is 29/05/2014, the function must return Thursday. You will use the following formula: m1 = ( m ? 2 if m ? 3 m + 10 if m < 3 a1 = ( a if m ? 3 a ? 1 if m < 3 and with ns being the two first digits of a1 and as the two last digits of a1, we can compute f as f = d + as + as 4 ? 2ns + ns 4 + 26m1 ? 2 10 The day of the week will then be given by the modulo of f and 7[f%7] ( Sunday for 0, Monday for 1, Tuesday for 2, Wednesday for 3, Thursday for 4, Friday for 5, Saturday for 6). You must write a driver program to test your function.(USING C NOT C++)

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!