Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python (.py file) Note: Please comment the steps and post a screenshot of your output and trials. For this assignment you will be writing a

Python (.py file)

Note: Please comment the steps and post a screenshot of your output and trials.

image 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 2019). To get started, open up the official Spring 2019 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: President's Day Spring Recess: Last day of classes: Monday, January 28, 2019 Monday, February 18, 2019 March 18 -March 24, 2019 Monday, May 13, 2019 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: March 21 is during Spring Break. This is a school holiday at NYU If the day selected is not a holiday, the program should print out a message such as April 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 10 is before the Spring 2019 term. June 1 is after the Spring 2019 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/28 05/22) 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 (e.g. Spring Break) stretch out over multiple days. Your program can assume that the user will type in can be used as 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 2019 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. Some NYU holidays (e.g. Spring Break) stretch out over multiple days. Your program can assume that the user will type in can be used as 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 2019 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 /I 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 2019 term. // run3 Enter a month (1-12): 4 Enter a day (1-31): 31 That's not a valid date! /I run 3 Enter a month (1-12): 2 Enter a day (1-31): 13 February 13 is not a holiday at NYU. NYU is open on this day. // run 4 Enter a month (1-12): 3 Enter a day (1-31): 19 March 19 is during Spring Break. NYU is not open on this day. // run5 Enter a month (1-12): 5 Enter a day (1-31): 40 That's not a valid date! /I run 6 Enter a month (1-12): 5 Enter a day (1-31): 29 May 29 is after the end of the Spring 2019 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_2

Step: 3

blur-text-image_3

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

Question

What is business strategy?

Answered: 1 week ago

Question

Choose an appropriate organizational pattern for your speech

Answered: 1 week ago

Question

Writing a Strong Conclusion

Answered: 1 week ago