Question: Written in python Problem #3: Is there class today? For this assignment you will be writing a 'diagnostic program that will be able to tell

Written in python
Problem #3: Is there 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 (Spring 2020). The program should begin by asking the user to supply a date in the following format: YYYYMMDD For example, 20280218 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: 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 The date is before the beginning of the semester (before January 27th, 2020) The date is after the end of the semester (after May 11th, 2020) The date is during the semester AND is one of the days that we have class (see our class schedule to the left for a complete list of days - note that each class should use its own schedule) The date is during the semester AND IS NOT one of the days that we have class Here are a few sample runnings of the program using the schedule for the Tuesday section of the class (underlined text indicates user input): Enter a date in YYYYMMDD format (i.e. 20200128 for January 28th, 2020): 20200128 You have class today Enter a date in YYYYMMDD format (i.e. 20200128 for January 28th, 2020): 20200931 That's not a valid date! Enter a date in YYYYMMDD format (i.e. 20200128 for January 28th, 2020): 20200101 This date is before the semester begins Enter a date in YYYYMMDD format (i.e. 20200128 for January 28th, 2020): 20200918 This date is after the semester ends Enter a date in YYYYMMDD format (i.e. 20200128 for January 28th, 2020): 20180230 That's not a valid date! Hints: 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. Look back at Assignment #2 if you are having trouble isolating the year, month and day from the single integer that the user is providing. There are many different conditions to test in this program, and many different ways to approach the problem. My advice is to pick one criteria (i.e. invalid dates) and start there -- once you've identified the supplied value as invalid you don't need to continue analyzing it. You cannot assume that if your program works with the sample inputs above that it is complete - you will need to design a series of tests" to make sure your program works under all circumstances. Extra Credit: implement your program so that it supports "leap years". A "leap year is a year in which February has 29 days instead of 28 - it can be computed as follows: In the Gregorian calendar three criteria must be taken into account to identify leap years: The year can be evenly divided by 4; If the year can be evenly divided by 100, it is NOT a leap year, unless; The year is also evenly divisible by 400
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
