Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python. Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An appointment has the date of an appointment, the month of an appointment,

Using Python. image text in transcribed

Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An appointment has the date of an appointment, the month of an appointment, the year of an appointment, and the description of an appointment (e.g., "see the dentist"). In other words, four major instant variables in these classes. Then, write a method occcursOn(year, month, day) that checks whether the appointment occurs on that date. Ensure to have a test program to test your classes. In your test program, you should create a list of appointments using the concept of polymorphism as your appointment pool. In other words, creating multiple objects using your subclasses of Onetime, Daily, and Monthly. Once you have those appointments available, allow the user to input day, month, and year to check whether the day of the month matches and print out the information of that matched appointment. For example, for a monthly appointment, you must check whether the day of the month matches. Have the user enter a date and print out all appointments that occur on that date. Notes: you should submit two files: one class/subclass files and one test file Example output from the test file: Enter the day (0 to quit) 15 Enter the month: 12 Enter the year: 2018 Daily appointment starting (01/01/2018): Do pushups Monthly appointment starting (15/12/2018) Backup data Implement a superclass Appointment and subclasses Onetime, Daily, and Monthly. An appointment has the date of an appointment, the month of an appointment, the year of an appointment, and the description of an appointment (e.g., "see the dentist"). In other words, four major instant variables in these classes. Then, write a method occcursOn(year, month, day) that checks whether the appointment occurs on that date. Ensure to have a test program to test your classes. In your test program, you should create a list of appointments using the concept of polymorphism as your appointment pool. In other words, creating multiple objects using your subclasses of Onetime, Daily, and Monthly. Once you have those appointments available, allow the user to input day, month, and year to check whether the day of the month matches and print out the information of that matched appointment. For example, for a monthly appointment, you must check whether the day of the month matches. Have the user enter a date and print out all appointments that occur on that date. Notes: you should submit two files: one class/subclass files and one test file Example output from the test file: Enter the day (0 to quit) 15 Enter the month: 12 Enter the year: 2018 Daily appointment starting (01/01/2018): Do pushups Monthly appointment starting (15/12/2018) Backup data

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

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

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

Did you follow BANGPP design checklist to review the layout?

Answered: 1 week ago