Question: Please implement the following problem in basic C++ code and include detailed comments so that I am able to understand the processes for the solution.

Please implement the following problem in basic C++ code and include detailed comments so that I am able to understand the processes for the solution. Thanks in advance.

Please implement the following problem in basic C++ code and include detailed

// Driver Program with class personType

#include  #include  using namespace std; // Base class personType class personType { public: void print()const; //Function to output the first name and last name //in the form firstName lastName. void setName(string first, string last); string getFirstName()const; string getLastName()const; personType(string first = "", string last = ""); //Constructor //Sets firstName and lastName according to the parameters. //The default values of the parameters are null strings. //Postcondition: firstName = first; lastName = last private: string firstName; //variable to store the first name string lastName; //variable to store the last name }; void personType::print() const { cout  Printing... "; person1.print(); cout  Printing... "; doctor1.print(); cout  Printing... "; patient1.print(); cout  Printing... "; b1.print(); cout   Question1 (Inhe ritance) Derive the class doctorType, inherited from the class personType, with an additional class member variable member to store a doctor's specialty(string type) Then, implement following class member function prototypes. doctorTpestring.string string) Firsiname Tastname Specialty doctorType0;/Default constructor void selSpecialty(string)mSet doctor specialty string getSpecialtyconst; Get doctor specialty void print0const: Display doctor information the same as given output format Derive the class patintTvpe, inherited from the class bersonType, with additional class member variables to store a patient's id, age, and dob (all are integers). Then, implement following class member function prototypes patientlypesstring, string, int nt, int):istname Lastname id age dob patientType); Defauli constructor void settdlint);//Set patient id void setagelint);Set patient age void setDoblint);Set patient DOB int getld0const:/Get patient id int getage0const;Get patient int getDob0const; Get patient DOB void print0constDisplay patient information the same as given output format (Composition) .Design a class billType, with class member variables to store a patient's information patientpe), the patient's doctor's information (dostorType). and the hospital charges(double). Then, implement following class member function prototypes. billTypesdoctorType &d patientType d&p); Constructor void setChargesdouble);/Set hospital charges double getChargeDconstGet hospilal charges void print(const;//lisplay a bill information the same as given output format Use the provided driver program to test your program. You should get the same output. Output CAW exe  Printing erson FirstName=Lisa LastName=Regan  Printing. .. octor FirstName-Sarah LastName-Conner Specialty-Dentist patientType> Printing... atient FirstName-Sam LastName-Fire Id-200 Age-180 DOB-1916 billType> Printing... atient FirstName=Sam LastName-Fire Id=200 Age=100 DOB=1916 atient's doctor FirstName-Sarah LastName-Conner Specialty-Dentist lospital chrge-250.66 press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!