Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could I get some help with this python code? Thanks! For this assignment you will be writing a program that will be able to tell

image text in transcribedimage text in transcribedCould I get some help with this python code? Thanks!

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/dynamic/calendar/undergraduate/. These are the dates that you should account for during this academic term: Beginning of term: Presidents' Day Spring Recess: Semester ends Monday, January 27, 2020 Monday, February 17, 2020 Monday, March 16, 2020 - Friday, March 20, 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 "9" for the month and "14" for the day would represent September 14) The program will tell the user if school is not in session and tell the user why. For example: February 17 is Presidents' Day. This is a school holiday at NYU. If the day selected is not a holiday, the program should print out a message such as: March 1 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. May 31 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 (01/27 - 05/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. Please convert numeric months values into their English equivalents for a more readable output. 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: Hints: The program should make sure that the user provides a date within the correct range (01/27 - 05/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. Please convert numeric months values into their English equivalents for a more readable output. 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: # run 1 Enter a month (1-12): 0 Enter a day (1-31): 0 Sorry, that's not a valid date. # run 2 Enter a month (1-12): 1 Enter a day (1-31): 1 January 1 is before the start of the Spring 2020 term. # run 3 Enter a month (1-12): 4 Enter a day (1-31): 31 That's not a valid date! # run 3 Enter a month (1-12): 3 Enter a day (1-31): 1 March 1 is not a holiday at NYU. NYU is open on this day. # run 4 Enter a month (1-12): 2 Enter a day (1-31): 17 February 17 is Presidents' Day. This is a school holiday at NYU. # run 5 Enter a month (1-12): 3 Enter a day (1-31): 40 That's not a valid date! # run 6 Enter a month (1-12): 5 Enter a day (1-31): 29 May 29 is after the end of 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/dynamic/calendar/undergraduate/. These are the dates that you should account for during this academic term: Beginning of term: Presidents' Day Spring Recess: Semester ends Monday, January 27, 2020 Monday, February 17, 2020 Monday, March 16, 2020 - Friday, March 20, 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 "9" for the month and "14" for the day would represent September 14) The program will tell the user if school is not in session and tell the user why. For example: February 17 is Presidents' Day. This is a school holiday at NYU. If the day selected is not a holiday, the program should print out a message such as: March 1 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. May 31 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 (01/27 - 05/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. Please convert numeric months values into their English equivalents for a more readable output. 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: Hints: The program should make sure that the user provides a date within the correct range (01/27 - 05/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. Please convert numeric months values into their English equivalents for a more readable output. 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: # run 1 Enter a month (1-12): 0 Enter a day (1-31): 0 Sorry, that's not a valid date. # run 2 Enter a month (1-12): 1 Enter a day (1-31): 1 January 1 is before the start of the Spring 2020 term. # run 3 Enter a month (1-12): 4 Enter a day (1-31): 31 That's not a valid date! # run 3 Enter a month (1-12): 3 Enter a day (1-31): 1 March 1 is not a holiday at NYU. NYU is open on this day. # run 4 Enter a month (1-12): 2 Enter a day (1-31): 17 February 17 is Presidents' Day. This is a school holiday at NYU. # run 5 Enter a month (1-12): 3 Enter a day (1-31): 40 That's not a valid date! # run 6 Enter a month (1-12): 5 Enter a day (1-31): 29 May 29 is after the end of the Spring 2020 term

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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