Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In python 4. Do we have class today? For this assignment you will be writing a diagnostic program that will be able to tell a
In python
4. Do we have class today? For this assignment you will be writing a "diagnostic program that will be able to tell a user whether s/he has our class on any given day during the current semester (Fall 2020). The program should begin by asking the user to supply a date in the following format: YYYYMMDD For example, 20200218 would be interpreted as February 18th, 2020. You can always assume that the user will supply an 8 digit integer. Next, the program should diagnose the date as one of the following: (a) The date is invalid (i.e. 20205701 is invalid because there is no 57th month of the year, 20010931 is invalid because there are not 30 days in the month of September). Note that for the purpose of the basic version of the program February will always have 28 days (b) The date is before the beginning of the semester (before September 2nd, 2020) (c) The date is after the end of the semester (after December 21, 2020) (d) The date is during the semester AND is one of the days that we have class (see our class schedule on the course website) (e) The date is during the semester AND IS NOT one of the days that we have class For this problem, assume class is only held on the following days in 2020: 9/03, 9/08, 9/10, 9/15, 9/17, 9/22, 9/24, 9/29 10/01, 10/06, 10/08, 10/13, 10/15, 10/20, 10/22, 10/27, 10/29 11/03, 11/05, 11/10, 11/12, 11/17, 11/19, 11/24 12/01, 12/03, 12/08, 12/10 Here are a few sample runnings of the program using the course schedule: Enter a date in YYYYMMDD format (i.e. 20200903 for September 3rd, 2020): 20200903 You have class today Enter a date in YYYYMMDD format (i.e. 20200903 for September 3rd, 2020): 20200931 That's not a valid date! Enter a date in YYYYMMDD format (i.e. 20200903 for September 3rd, 2020): 20200901 This date is before the semester beginsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started