I am taking a C++ class and I was just introduced to Polymorphism and Inheritanc
ID: 638176 • Letter: I
Question
I am taking a C++ class and I was just introduced to Polymorphism and Inheritance and given an assignment on it. I'm exttremely confused on this assignment and I need help.
Define and implement base class Appointment and (publicly) derived classes
OneTime, Daily, Month, and Yearly as described in the introduction. Create
separate interface (.h) files and implementation (.cpp) files for each class.
The derived classes must all override both virtual inherited
methods.
4. Complete application file AppointmentBookApp.cpp by implementing the
following functions used in main():
Explanation / Answer
Example Interaction:
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: b Enter date and time (dd mm yyyy hr min): 12 1 2014 15 30 Enter description: Guest Lecture Enter appointment type: (1) for one-time, (2) for daily, (3) for monthly, (4) for yearly: 1
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: b Enter date and time (dd mm yyyy hr min): 01 01 2014 18 00 Enter description: Jog Enter appointment type: (1) for one-time, (2) for daily, (3) for monthly, (4) for yearly: 2
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: b Enter date and time (dd mm yyyy hr min): 16 1 2014 11 00 Enter description: Haircut Enter appointment type: (1) for one-time, (2) for daily, (3) for monthly, (4) for yearly: 3
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 12 1 2014 Appointments on 12/1/2014: 15:30 -> Guest Lecture (One Time) 18:00 -> Jog (Daily)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 16 2 2015 Appointments on 16/2/2015: 18:00 -> Jog (Daily) 11:00 -> Haircut (Monthly)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 23 1 2016 Appointments on 23/1/2016: 18:00 -> Jog (Daily)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: b Enter date and time (dd mm yyyy hr min): 23 1 2014 08 00 Enter description: Physical Enter appointment type: (1) for one-time, (2) for daily, (3) for monthly, (4) for yearly: 4
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 23 1 2016 Appointments on 23/1/2016: 18:00 -> Jog (Daily) 8:00 -> Physical (Yearly)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: b Enter date and time (dd mm yyyy hr min): 16 3 2014 14 00 Enter description: Accountant Meeting Enter appointment type: (1) for one-time, (2) for daily, (3) for monthly, (4) for yearly: 4
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment.Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 16 3 2014 Appointments on 16/3/2014: 18:00 -> Jog (Daily) 11:00 -> Haircut (Monthly) 14:00 -> Accountant Meeting (Yearly)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: a Enter date (dd mm yyyy): 2 1 2014 Appointments on 2/1/2014: 18:00 -> Jog (Daily)
********** Appointment Book Application ************
(a) See all appointments on a given day. (b) Add an appointment. Enter an option or 'q' to quit: q
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.