Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment you will be writing a program that will be able to tell a user whether s/he has the day off for any

image text in transcribedimage text in transcribedimage text in transcribed

For this assignment you will be writing a program that will be able to tell a user whether s/he has the day off for any given day during the current semester (Spring 2020). To get started, open up the official Spring 2020 academic calendar by visiting this link: https://cs.nyu.edu/webapps/Undergraduate/calendar. These are the dates that you should account for during this academic term: Beginning of term: Presidents Day: Spring Recess: Last day of classes: End of term: Monday, January 27, 2020 Monday, February 17, 2020 Monday, March 16 - March 22, 2020 Monday, May 11, 2020 Tuesday, May 19, 2020 Here is how it should work: The user should be prompted to enter a number for the month and then prompted to enter a number for the day. (For example, entering "2" for the month and "14" for the day would represent February 14) The program will tell the user if school is not in session and tell the user why. For example: October 14 is Spring Recess. This is a school holiday at NYU. If the day selected is not a holiday, the program should print out a message such as: September 19 is not a school holiday at NYU. Do not worry about weekends. You can report that NYU is open if the user enters a weekend date. Your program should also handle dates that come before or after the semester. For example: January 1 is before the Spring 2020 term. August 30 is after the Spring 2020 term. Your program should also handle invalid dates. For example: Enter a month: 13 Enter a day: 7 That's not a valid date! Enter a month: 2 Enter a day: 30 That's not a valid date! Hints: The program should make sure that the user provides a date within the correct range (09/03/19 - 12/20/19) and tell the user if they picked a date outside of the dates under consideration. The program should check to be sure that the month and day that the student enters are valid and tell the user if they are not. Some NYU holidays stretch out over multiple days. Your program can assume that the user will type in an integer. You should convert all values given to you by the user into integers for calculation purposes. You can assume that all dates entered are for the year 2020. . It might be helpful to convert numeric months values into their English equivalents. You can do this using a series of "if" statements to test the number for the month and then store the English version of the month in a new variable. For example: Enter a month (1-12): 5 Month #5 is May. Here are some sample runnings of the program: Enter a month (1-12): 0 Enter a day (1-31): 0 That's not a valid date! Enter a month (1-12): 1 Enter a day (1-31): 24 January 24 is before the Spring 2020 term. Enter a month (1-12): 4 Enter a day (1-31): 31 That's not a valid date! Enter a month (1-12): 2 Enter a day (1-31): 4 February 4 is not a holiday at NYU. The university is open. Enter a month (1-12): 4 Enter a day (1-31): 9 April 9 is not a holiday at NYU. The university is open. Enter a month (1-12): 3 Enter a day (1-31): 16 March 16 is Spring Recess. This is a school holiday at NYU. Enter a month (112): 2 Enter a day (1-31): 40 That's not a valid date! Enter a month (1-12): 3 Enter a day (1-31): -5 That's not a valid date! Enter a month (1-12): 5 Enter a day (1-31): 24 May 24 is after the Spring 2020 term. For this assignment you will be writing a program that will be able to tell a user whether s/he has the day off for any given day during the current semester (Spring 2020). To get started, open up the official Spring 2020 academic calendar by visiting this link: https://cs.nyu.edu/webapps/Undergraduate/calendar. These are the dates that you should account for during this academic term: Beginning of term: Presidents Day: Spring Recess: Last day of classes: End of term: Monday, January 27, 2020 Monday, February 17, 2020 Monday, March 16 - March 22, 2020 Monday, May 11, 2020 Tuesday, May 19, 2020 Here is how it should work: The user should be prompted to enter a number for the month and then prompted to enter a number for the day. (For example, entering "2" for the month and "14" for the day would represent February 14) The program will tell the user if school is not in session and tell the user why. For example: October 14 is Spring Recess. This is a school holiday at NYU. If the day selected is not a holiday, the program should print out a message such as: September 19 is not a school holiday at NYU. Do not worry about weekends. You can report that NYU is open if the user enters a weekend date. Your program should also handle dates that come before or after the semester. For example: January 1 is before the Spring 2020 term. August 30 is after the Spring 2020 term. Your program should also handle invalid dates. For example: Enter a month: 13 Enter a day: 7 That's not a valid date! Enter a month: 2 Enter a day: 30 That's not a valid date! Hints: The program should make sure that the user provides a date within the correct range (09/03/19 - 12/20/19) and tell the user if they picked a date outside of the dates under consideration. The program should check to be sure that the month and day that the student enters are valid and tell the user if they are not. Some NYU holidays stretch out over multiple days. Your program can assume that the user will type in an integer. You should convert all values given to you by the user into integers for calculation purposes. You can assume that all dates entered are for the year 2020. . It might be helpful to convert numeric months values into their English equivalents. You can do this using a series of "if" statements to test the number for the month and then store the English version of the month in a new variable. For example: Enter a month (1-12): 5 Month #5 is May. Here are some sample runnings of the program: Enter a month (1-12): 0 Enter a day (1-31): 0 That's not a valid date! Enter a month (1-12): 1 Enter a day (1-31): 24 January 24 is before the Spring 2020 term. Enter a month (1-12): 4 Enter a day (1-31): 31 That's not a valid date! Enter a month (1-12): 2 Enter a day (1-31): 4 February 4 is not a holiday at NYU. The university is open. Enter a month (1-12): 4 Enter a day (1-31): 9 April 9 is not a holiday at NYU. The university is open. Enter a month (1-12): 3 Enter a day (1-31): 16 March 16 is Spring Recess. This is a school holiday at NYU. Enter a month (112): 2 Enter a day (1-31): 40 That's not a valid date! Enter a month (1-12): 3 Enter a day (1-31): -5 That's not a valid date! Enter a month (1-12): 5 Enter a day (1-31): 24 May 24 is after the Spring 2020 term

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions