You will implement a date and day of week calculator for the 2016 calendar year. The calculator repeatedly reads in three numbers (in a line) from the standard input that are interpreted as month dayofmonth daysafter, calculates the dates in the year and days of week for the dates, and outputs the information. For example, input “1 1 31” is interpreted as the following: the first 1 means the 1st month in the year, January; the second 1 means the 1st day in January; and the 31 means 31 days after the date January 1, 2016 (we assume the year is 2016 to simplify the program), which is February 1, 2016. The program also calculates the days of week for each of the dates. More specifically, for input “1 1 31”, the calculator should produce the following output:
The first input number must be from 1 to 12 representing the 12 months in 2016, the second input number must be a day in the month (e.g. for 1-31 for January, 1-29 for February, and so forth). The third number is larger than or equal to 0. The program should report an error (and exit) if the input is incorrect. If a day is not in 2016, the program should output that. Following are a sample input file (redirect to be the standard input) and the corresponding output.