Question
Program this using python. Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An appointment has a description (for example, see the dentist) and
Program this using python.
Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An appointment has a description (for example, see the dentist) and a date. Write a method occursOn(year, month, day) that checks whether the appointment occurs on that date. For example, for a monthly appoint- ment, you must check whether the day of the month matches. Then fill a list of Appointment objects with a mixture of appointments. Have the user enter a date and print out all appointments that occur on that date.
Descrpition of assignment:
You will want to add a good user interface that would allow the user to get the appointments for, say, a specific date.
It should also allow this for, perhaps, today, tomorrow, or the next 7 days.
It might look something like this:
Get appointments for:
Today
Tomorrow
Seven days (including today)
A specific date
If a 1, 2 or 3 is entered, the appointments are listed. (It does not ask for todays date )
If a 4 is entered, then the user is prompted for the desired date, and the appointments are then listed.
It would be good if your program included a check for valid dates. In other words, the user could not enter 2/29/2017, since February does not have 29 days next year.
Use this program to show off everything that you can do with Python!
there really should be a time included, too. See attached for a sample input file. Like this
OneTime,4,10,2016,12:00 AM,Leash's Birthday
A file in CSV (comma-separated value) format is no different than a .txt (text) file. The csv extension simply tells a spreadsheet program (like Excel) how it should be imported. So if you specify the name of the file is whatever.csv, you can use the same file input and output steps that you have used before. Or you can rename the file from whatever.csv to whatever.txt.
Also note that you should have a superclass for Appointment, and then subclasses for the variations (e.g. Daily, OneTime, Monthly).
Again you will have a file with the main function, one [or more] files with the classes and a file for getData.
dates file is: Monthly,4,11,2016,11:30 AM,Book order OneTime,5,1,2016,12:00 AM,Buy Furnace Filters next Monday OneTime,4,10,2016,12:00 AM,Leash's Birthday OneTime,4,26,2016,10:00 AM,Maverick Tour Daily,4,1,2016,7:00 AM,Check sump pump OneTime,3,22,2016,8:00 AM,Board meeting OneTime,4,22,2016,12:00 AM,Boat Policy payment today OneTime,2,23,2016,1:45 PM,Blood Donation (redcrossblood.org) OneTime,1,22,2015,9:15 AM,Perio Appointment OneTime,5,6,2016,12:00 AM,Mandy's Birthday OneTime,4,30,2016,1:00 PM,Dental Appointment Monthly,4,1,2016,12:00 AM,Archive Email OneTime,4,22,2016,7:00 PM,*** SPRING FLING *** OneTime,4,6,2016,9:00 AM,*** CALL DFAS *** OneTime,5,7,2016,12:00 AM,Brooke's birthday OneTime,2,24,2016,2:45 PM,Annual Physical OneTime,6,28,2016,12:00 AM,Brett & Amanda's Wedding OneTime,4,9,2016,12:00 AM,Bob and Sally's Wedding OneTime,4,7,2016,12:00 AM,Amazon delivery of dog shampoos OneTime,4,1,2016,4:00 PM,Advising Session OneTime,6,10,2016,7:00 PM,Boy Scout phone call Daily,1,1,2015,8:00 PM,*** FLOSS *** Daily,1,20,2016,9:00 AM,Office Hours Daily,4,1,2016,7:00 PM,Coffee at 'Bou Monthly,1,1,2015,12:00 AM,Douglas' heartworm pill OneTime,4,28,2016,12:00 AM,Sarah and Ann's Wedding OneTime,4,1,2016,12:00 AM,Batteries in cabin security panel OneTime,1,11,2015,12:00 AM,AlumaCraft renewal on 29-DEC OneTime,4,5,2016,1:15 PM,Annual vision exam OneTime,2,17,2015,9:00 AM,Student Meeting Monthly,5,12,2016,12:00 AM,Expense Report OneTime,2,16,2015,12:00 PM,Student Meeting OneTime,4,15,2016,9:00 AM,Beagle & Wolf Book Club OneTime,4,25,2016,8:00 AM,Dental appointment
The csv file is the exact same as the data file but its in excel
Step 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