Question: ITEC243 Final Assignment Due Date is: 05.01.2022 11:59 PM Your answer whould be written in c++ format QUESTION 1 Using inheritance and composition, write the
ITEC243 Final Assignment
Due Date is: 05.01.2022 11:59 PM
Your answer whould be written in c++ format
QUESTION 1
Using inheritance and composition, write the following code to create the classes and the sample run and output for the main file.
A person has name(string) and id(int). The Person class uses a parameterized constructor to initialize its members. It also has a print function (printPerson) to display the details of its members.
o An Assistant class inherits Person and have specialty(string). This also uses a parameterized constructor to initialize its members. It also has a print function (printAssistant) to display the assistants details.
o A Doctor class inherits Person and have specialty(string). This also uses a parameterized constructor to initialize its members. It also has a print function (printDoctor) to display the doctors details. The Doctor class also includes 2 assistants (lab assistant and research assistant).
o A Patient class inherits Person and have an ailment(string). This also uses a parameterized constructor to initialize its members. It also has a print function (printDoctor) to display the patients details. The Patient class also includes a doctor object.
An Appointment class will have date, time (both strings) and a Patient object as its private member. The class will use a parameterized constructor to initialize its members. The class also includes a print method (printAppointment) to display the details of the appointment. Finally, create an appointment object in the main file and display the details as shown in the sample run and output in the next page.

SAMPLE RUN SAMPLE OUTPUT Research Assistant Details Appointment details Enter ID: 20 Date: 01/01/2023 Enter Name: John Doe Time: 10:30 AM Enter Specialty: Pediatrics Patient's details LabAssistantDetailsID:102 Enter ID: 21 Name: Anthony J. Crowley Enter Name: Jane Doe Doctors' Details Enter Specialty: Dermatology ID: 54 Name: Martin Clune Doctor Details Specialty: Family Medicine Enter ID: 54 Lab Assistant's details EnterName:MartinCluneID:21 Enter Specialty: Family Medicine Name: Jane Doe Specialty: Dermatology Patient Details Research Assistant's details Enter ID: 102 ID: 20 Enter Name: Anthony J. Crowley Name: John Doe Enter ailment: Eczema Specialty: Pediatrics Appointment Details Enter Date (DD/MM/YYY): 01/01/2023 Enter Time (HH:MM (AM/PM)): 10:30 AM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
