Write a function that, given a valid date made with a day d, a month m and a year y, returns its day of the week, that is, “Monday”, or “Tuesday”, or …
To compute it, use the congruence of Zeller. Let d be the day, m be the month, and y be the year. Then,
|f = ⌊ 2.6m′ − 0.2 ⌋ + d + a + ⌊ a/4 ⌋ + ⌊ c/4 ⌋ − 2c.|
string day_of_the_week (int d, int m, int y);
char* day_of_the_week (int d, int m, int y);
public static String day_of_the_week (int d, int m, int y);
day_of_the_week (d, m, y) # returns str
day_of_the_week (d: int, m: int, y: int) -> str
dayOfTheWeek :: Int -> Int -> Int -> String
Precondition The parameter y is between 1800 and 9999, both included. The date is valid.
Watch out for modulos of negative numbers!
Observation You only need to submit the required procedure; your main program will be ignored.