Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please follow the instructions given above and ensure that all of the classes and functions are mentioned in the code. Also, show how the output
Please follow the instructions given above and ensure that all of the classes and functions are mentioned in the code. Also, show how the output looks with a screenshot of your output program. Someone already "answered" this problem on Chegg before but they did a really poor job at it.
Thank you so much.
xercise L1-2 Chapter 11 Inheritance \& Composition his exercise is designed so each patient can have multiple doctors, and multiple bills. The details are listed below Design the class doctorType, inherited from the class person Type, given below. Add a data member to st the doctors specialty. Also add appropriate constructors and member functions to initialize, access, and manipulate the data members. \#pragma once \#include tring using namespace std; 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); //Function to set firstName and lastWame according // to the parameters. //Postcondition: firstName = first; lastName = last string getFirstName() const; // Function to return the first name. //Postcondition: The value of the data member firstName // is returned. string getLastName () const; //Function to return the last name. //Postcondition: The value of the data member lastName // is returned. personType(string first =, string last ="); // constructor //Sets firstName and lastName according to the parameters. //The default values of the parameters are empty 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 firstName "" lastName; void personType::setName(string first, string last) \{ firstName = first; lastName = last; \} string personType: getFirstName() const \{ \} return firstName; string personType: :getLastName() const \{ return lastName; 3 // constructor personType::personType(string first, string last) firstName = first; lastName = last; \} B. Designed the class billType with data members to store a patients ID and a patient's hospital charges, such as pharmacy charges for medicine, Doctors fee, and room charges. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. C. Design the class patientType, inherited from the class personType, with additional data members to store the patients ID, the age, date of birth, attending Physicians name, the date when the patient was admitted in the hospital, and the date when the patient was discharged from the hospital. (use the class dateType to store the date of birth, admit date, discharge date, and the class doctorType to store to be attending Physicians name.) Add appropriate constructors and member functions to initialize, access, and manipulate the data members. D. Write a program to test your classes. You can check your class definitions by using L1-2CmplTest.cpp found in the L1-2 folder. Your output should look like this Class members doctorType Class must contoin at least these functions doctorType(string first, string last, string spl); //First Name, Last Name, Specialty void print0 const, //Formatted Display First Name, Last Name, S void setSpeciality(string); / Set the doctor's Specialty string getSpeciality0; /IReturn the doctor's Specialty atientType Class must contoin ot leost these functions void setinfo( string id, string fName, string IName, int bDay, int bMth, int bYear, string docFrName, string docLaName, string docSpl, int admDay, int admMth, int admYear, int disChDay, int disChMth, int disChYear); void setiD(string); string getlD0; void setBirthDate(int dy, int mo, int yr); int getBirthDay0; int getBirthMonth 0 ; int getBirthYear0; void setDoctorName(string fName, string IName); void setDoctorSpl(string); string getDoctorFName0; string getDoctorLName0; string getDoctorSpl0; void setAdmDate(int dy, int mo, int yr); int getAdmDayO; int getAdmMonth 0 ; int getAdmYear(;; void setDisDate(int dy, int mo, int yr); int getDisDay0; int getDisMonth0; int getDisYear0; The instructors test program will construct arrays of 10 doctorType, 10 patientTye and 20 bill Type instances and from this data will produce the report shown on the next page. All patients will have 1 or more billings. Make sure you validate your three classes against all the functions shown above. The instructor output will be billings by patient and will provide summary data similar to the screen shot on the next page. If you need help with using this for your testing contact the instructor
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