Question
C++ Please read the intructions below carefully before you answer the question! Output example is given at the end and should match!! Download Lab10.cpp (given
C++
Please read the intructions below carefully before you answer the question! Output example is given at the end and should match!!
Download Lab10.cpp (given below). In this file, the definition of the class personType has given. Think of the personType as the base class.
Lab10.cpp is provided below:
#include
void personType::print() const { cout << "Person FirstName="<
Question:
Derive the class doctorType, inherited from the class personType, with an additional class member variable member to store a doctors specialty(string type) Then, implement following class member function prototypes. doctorType(string,string,string);//Firstname Lastname Specialty doctorType();//Default constructor void setSpecialty(string);//Set doctor specialty string getSpecialty()const;// Get doctor specialty void print()const;//Display doctor information the same as given output format
Derive the class patientType, inherited from the class personType, with additional class member variables to store a patients id , age , and dob (Date of birth)(All are integer ). Then, implement following class member function prototypes. patientType(string, string, int, int, int);//Firstname Lastname id age dob patientType();Default constructor void setId(int);//Set patient id void setage(int);//Set patient age void setDob(int);//Set patient DOB int getId()const;//Get patient id int getage()const;//Get patient int getDob()const;//Get patient DOB void print()const; //Display patient information the same as given output format
Design a class billType, with class member variables to store a patients information (patientType ), the patients doctors information ( doctorType ), and the hospital charges( double ). Then, implement following class member function prototypes. billType(doctorType &, patientType &); // Constructor void setCharge(double);//Set hospital charges double getCharge()const;//Get hospital charges void print()const;//Display 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:
Person FirstName=Lisa LastName=Regan
Doctor FirstName=Sarah LastName=Conner Specialty=Dentist
Patient FirstName=Sam LastName=Fire Id=200 Age=100 DOB=1916
Patient FirstName=Sam LastName=Fire Id=200 Age=100 DOB=1916
Patient's doctor FirstName=Sarah LastName=Conner Specialty=Dentist
Hospital charge=250.66$
Press any key to continue...
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