Reference no: EM132208444
Write this program in C: A professor will assign homework today and does not want it due on anybody's holy day.
The professor enters today's day of the week (0 for Sunday, 1 for Monday, etc.) and the number of days, D, to allow the students to do the work, which may be several weeks. Calculate the day of the week on which the work would be due.
If that day is someone's holy day-Friday (Moslems),Saturday (Jews), or Sunday (Christians)-add enough days to D to reach the following Monday. Print the corrected value of D and the day of the week the work is due.
1) Use a switch statement for calculating the number of days based on today's day.
2) If the entered day for today is not in the range of 0 to 6, display an error message and abort the program.
3) Display the corrected value of the number of days and the day of the week the work is due. For example, if today is Thursday, and the number of days D is 8, then the due date falls on Friday, then 3 days will be added to reach the following Monday. So the corrected value of D is 11.