Homework Solution: In this project, you will design various classes and write a program to computerize the billing system of a hospital….

    In this project, you will design various classes and write a program to computerize the billing system of a hospital. a. Design the class doctorType, inherited from the class personType, defined in Chapter 10, with an additional data member to store a doctor’s speciality. Here is the UML diagram for this class: doctorType UML b.    Design the class billType with data members to store a patient’s ID and a patient’s hospital charges, such as pharmacy charges for medicine, doctor’s fee, and room charges. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Here is the UML diagram for this class: billType UML c. Design the class patientType, inherited from the class personType, defined in Chapter 10, with additional data members to store a patient’s ID, age, date of birth, attending physician’s 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 the attending physician’s name.) Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Here is the UML diagram for this class: patientType UML Write a program to test your classes: Create a patientType object and a billType object for that patient using the constructors and passing parameters with initial values to them.. Use the print functions from both objects to display the patient's information and charges. Create a different patientType object using the default constructor. Use the setter and getter member functions to set and display the patient's information. Create a third patientType object using the constructor with parameters, but pass it a bad date. Here is an example of what the output should look like: Test Output Turn in all your .h files, all your implementation files, and your test program. Make sure your header files are properly documented. Also turn in one or more screen shots showing the results of your testing. Once this project is completed, you will demonstrate that you can Utilize inheritance and composition in designing classes Utilize polymorphism by overriding base class functions Distinguish between accessing the members of a derived class from accessing the members of an aggregate class Distinguish between applying the constructor for a derived class and applying the constructor of an aggregate class

    Expert Answer

     
    header files #ifndef PERSONTYPE_H

    In this scheme, you succeed artifice uncertain systematizees and transcribe a program to computerize the billing rule of a hospital.

    a. Artifice the systematize masterType, ancestral from the systematize personType, defined in Chapter 10, with an affixed basis portion to fund a master’s division. Here is the UML diagram coercion this systematize:

    doctorType UML

    b.    Artifice the systematize billType with basis portions to fund a unrepining’s ID and a unrepining’s hospital reckoning, such as pharmacy reckoning coercion physic, master’s fee, and ground reckoning. Add embezzle perpetrators and portion functions to judiciousize, way, and wield the basis portions. Here is the UML diagram coercion this systematize:

    billType UML

    c. Artifice the systematize unrepiningType, ancestral from the systematize personType, defined in Chapter 10, with affixed basis portions to fund a unrepining’s ID, period, determination of extraction, accompanying physician’s spectry, the determination when the unrepining was promoteted in the hospital, and the determination when the unrepining was dismissd from the hospital. (Use the systematize determinationType to fund the determination of extraction, promote determination, dismiss determination, and the systematize masterType to fund the accompanying physician’s spectry.) Add embezzle perpetrators and portion functions to judiciousize, way, and wield the basis portions. Here is the UML diagram coercion this systematize:

    patientType UML

    Transcribe a program to standard your systematizees:

    Create a unrepiningType end and a billType end coercion that unrepining using the perpetrators and cessation parameters with judicious values to them.. Use the stereotype functions from twain ends to ostentation the unrepining’s counsel and reckoning.

    Create a incongruous unrepiningType end using the want perpetrator. Use the fixedter and getter portion functions to fixed and ostentation the unrepining’s counsel.

    Create a third unrepiningType end using the perpetrator with parameters, excepting by it a out-of-sorts determination.

    Here is an stance of what the output should face approve:

    Standard Output

    Transform in integral your .h files, integral your implementation files, and your standard program. Make unquestioning your header files are properly documented. Also transform in undivided or more shelter shots showing the results of your standarding.

    Once this scheme is completed, you succeed evince that you can

    Utilize legacy and settlement in artificeing systematizees

    Utilize polymorphism by overriding infamous systematize functions

    Distinguish among waying the portions of a extraneous systematize from waying the portions of an gist systematize

    Distinguish among applying the perpetrator coercion a extraneous systematize and applying the perpetrator of an gist systematize

    Expert Acceptance

     

    header files
    #ifndef PERSONTYPE_H
    #define PERSONTYPE_H

    systematize PersonType
    {
    public:
    void stereotype() const;
    void FixedName(string highest, string terminal);
    string getFirstName() const;
    string getLastName() const;
    PersonType(string highest, string terminal);
    PersonType();//want perpetrator

    private:
    string HighestName, TerminalName;
    };

    #endif

    #ifndef DOCTORTYPE_H
    #define DOCTORTYPE_H

    systematize MasterType : generally-known PersonType
    {
    public:
    void FixedSpeciality(string Special);
    string getSpeciality() const;
    DoctorType(string HighestName,string TerminalName,string Special);
    DoctorType();//want perpetrator

    private:
    string Division;
    };

    #endif

    #ifndef DATETYPE_H
    #define DATETYPE_H

    systematize DeterminationType
    {
    public:
    DateType(){}
    void stereotypeDate() const;
    void FixedDate(int Day, int Month, int Year);
    int getTheDay() const;
    int getTheMonth() const;
    int getTheYear() const;
    DateType(int Day,int Month, int Year);

    private:
    int TheDay, TheYear, TheMonth;
    };

    #endif

    #ifndef DATEOFBIRTHTYPE_H
    #define DATEOFBIRTHTYPE_H
    systematize DeterminationOfBirthType : generally-known DeterminationType
    {
    public:
    DateOfBirthType(){}
    void stereotypeDOB() const;
    void FixedDOB(int Day, int Month, int Year);
    int getTheDay() const;
    int getTheMonth() const;
    int getTheYear() const;

    private:
    int TheDay, TheYear, TheMonth;
    };

    #endif

    #ifndef ADMITTANCETYPE_H
    #define ADMITTANCETYPE_H
    systematize PromotetanceDateType : generally-known DeterminationType
    {
    public:
    AdmittanceDateType(){}
    void stereotypeAdmittanceDate() const;
    void FixedAdmittanceDate(int Day, int Month, int Year);
    int getTheDay() const;
    int getTheMonth() const;
    int getTheYear() const;

    private:
    int TheDay, TheYear, TheMonth;
    };

    #endif

    #ifndef DISCHARGEDATETYPE_H
    #define DISCHARGETYPE_H
    systematize DismissDateType : generally-known DeterminationType
    {
    public:
    DischargeDateType(){}
    void stereotypeDischargeDate() const;
    void FixedDischargeDate(int Day, int Month, int Year);
    int getTheDay() const;
    int getTheMonth() const;
    int getTheYear() const;

    private:
    int TheDay, TheYear, TheMonth;
    };

    #endif

    #ifndef BILLTYPE_H
    #define BILLTYPE_H
    systematize BillType
    {
    private :
    wrap physicCharge;
    wrap masterFee;
    wrap groundCharges;

    public:
    BillType(wrap mCharge,wrap dFee,wrap rCharges);

    void stereotypeBill();

    };
    #endif

    #ifndef PATIENTTYPE_H
    #define PATIENTTYPE_H
    systematize UnrepiningType : generally-known PersonType
    {
    public:
    void stereotype() const;
    void FixedPatientID(int ID);
    void FixedPatientAge(int Period);
    int getPatientAge() const;
    int getPatientID() const;

    PatientType(string HighestName,string TerminalName,int ID,int Period);
    PatientType();//want perpetrator

    private:
    int UnrepiningID, UnrepiningAge;
    };

    #endif

    cpp file

    #include <iostream>
    #include <cstring>
    #include “PersonType.h”
    #include “DoctorType.h”
    #include “DateType.h”
    #include “DateOfBirthType.h”
    #include “AdmittanceType.h”
    #include “DischargeDateType.h”
    #include “BillType.h”
    #include “PatientType.h”

    using spectryspace std;

    void PersonType :: stereotype() const
    {
    cout << HighestSpectry << ” ” << TerminalSpectry << endl;
    }
    void PersonType :: FixedName(string highest, string terminal)
    {
    FirstSpectry = highest;
    LastSpectry = terminal;

    }
    string PersonType :: getFirstName() const
    {
    retransform HighestName;
    }
    string PersonType :: getLastName() const
    {
    retransform TerminalName;
    }
    PersonType :: PersonType(string highest, string terminal)
    {
    FirstSpectry = highest;
    LastSpectry = terminal;
    }
    PersonType :: PersonType()
    {
    FirstSpectry = ” “;
    LastSpectry = ” “;
    }

    void MasterType :: FixedSpeciality(string Special)
    {
    Division = Special;

    }
    string MasterType :: getSpeciality() const
    {
    retransform Division;
    }

    //cessation arguments to infamous systematize perpetrator
    DoctorType :: MasterType(string HighestName,string TerminalName,string
    Special):PersonType(FirstName,LastName)
    {
    Division = Special;
    }
    DoctorType :: MasterType()
    {
    Division = ” “;
    }

    void DeterminationType :: stereotypeDate() const
    {
    cout << TheDay << ” ” << TheMonth << ” ” << TheYear << endl;
    }
    void DeterminationType :: FixedDate(int Day, int Month, int Year)
    {
    TheDay = Day;
    TheMonth = Month;
    TheYear = Year;

    }
    int DeterminationType :: getTheDay() const
    {
    retransform TheDay;
    }
    int DeterminationType :: getTheMonth() const
    {
    retransform TheMonth;
    }
    int DeterminationType :: getTheYear() const
    {
    retransform TheYear;
    }
    DateType::DateType(int Day, int Month, int Year)
    {
    TheDay = Day;
    TheMonth = Month;
    TheYear = Year;
    }

    void DeterminationOfBirthType :: stereotypeDOB() const
    {
    cout << “Patients Determination Of Extraction: ” << TheDay << “/” << TheMonth <<
    “/” << TheYear << endl;
    }
    void DeterminationOfBirthType :: FixedDOB(int Day, int Month, int Year)
    {
    TheDay = Day;
    TheMonth = Month;
    TheYear = Year;

    }

    void PromotetanceDateType :: stereotypeAdmittanceDate() const
    {
    cout << “The Unrepinings Promotetance Determination: ” << TheDay << ” ” <<
    TheMonth << ” ” << TheYear << endl;
    }
    void PromotetanceDateType :: FixedAdmittanceDate(int Day, int Month, int Year)
    {
    TheDay = Day;
    TheMonth = Month;
    TheYear = Year;

    }

    void DismissDateType :: stereotypeDischargeDate() const
    {
    cout << “The Unrepinings Dismiss Determination: ” << TheDay << ” ” <<
    TheMonth << ” ” << TheYear << endl;
    }
    void DismissDateType :: FixedDischargeDate(int Day, int Month, int Year)
    {
    TheDay = Day;
    TheMonth = Month;
    TheYear = Year;

    }

    BillType::BillType(wrap mCharge,wrap dFee,wrap rCharges)
    {
    medicineCharge = mCharge;
    doctorFee = dFee;
    roomReckoning = rCharges;
    }
    void BillType::printBill()
    {
    cout<<“nTotal Bill : $”<<(medicineCharge+doctorFee+roomCharges);
    }
    };

    int UnrepiningType::getPatientID() const
    {
    retransform UnrepiningID;
    }
    int UnrepiningType::getPatientAge() const
    {
    retransform UnrepiningAge;
    }
    //cessation arguments to infamous systematize perpetrator
    PatientType::PatientType(string HighestName,string TerminalName,int ID,int
    age):PersonType(FirstName,LastName)
    {
    PatientID = ID;
    PatientPeriod = period;
    }
    PatientType::PatientType()
    {
    PatientID = 0;
    PatientPeriod = 0;
    }
    int main()
    {
    int select,age,pID,day,month,year,aDay,aMonth,aYear,dDay,dMonth,dYear;
    string fname,lname,speciality;
    wrap mcharge,dfee,rcharges;

    cout << “Who would you approve to input counsel coercion?n”;
    cout << ” 1 – Mastern”;
    cout << ” 2 – Unrepiningn”;
    cin >> select;

    if (select == 1)
    {
    cout<<“nEnter master highest spectry :”;
    cin>>fname;
    cout<<“nEnter master terminal spectry :”;
    cin>>lname;
    cout<<“Enter division : “;
    cin>>speciality;
    DoctorType d(fname,lname,speciality);
    cout<<“Master : “<<d.getFirstName()<<” “<<d.getLastName()<<”
    Division : “<<d.getSpeciality();
    }
    else if (select == 2)
    {
    cout<<“nEnter unrepining highest spectry : “;
    cin>>fname;
    cout<<“nEnter unrepining terminal spectry :”;
    cin>>lname;
    cout<<“nEnter unrepining’s period : “;
    cin>>age;
    cout<<“nEnter unrepiningID : “;
    cin>>pID;

    cout<<“nEnter day of extraction of unrepining : “;
    cin>>day>>month,year;

    cout << “Enter The Unrepinings DAY Of Promotetance.n”;
    cin >> aDay;
    cout << “Enter The Unrepinings MONTH Of Promotetance.n”;
    cin >> aMonth;
    cout << “Enter The Unrepinings YEAR Of Promotetance.n”;
    cin >> aYear;
    cout << “Enter The Unrepinings DAY Of Dismiss.n”;
    cin >> dDay;
    cout << “Enter The Unrepinings MONTH Of Dismiss.n”;
    cin >> dMonth;
    cout << “Enter The Unrepinings YEAR Of Dismiss.n”;
    cin >> dYear;

    cout<<“nEnter physic reckoning ,master fee and ground reckoning :”;
    cin>>mcharge>>dfee>>rcharges;
    PatientType p(fname,lname,pID,age);
    cout<<“Unrepining :”<<p.getFirstName()<<” “<<p.getLastName()<<” ID
    :”<<p.getPatientID()<<” Period : “<<p.getPatientAge();

    DateOfBirthType d;
    d.SetDOB(day,month,year);
    d.printDOB();

    AdmittanceDateType adt;
    adt.SetAdmittanceDate(aDay,aMonth,aYear);
    adt.printAdmittanceDate();

    DischargeDateType ddt;
    ddt.SetDischargeDate(dDay,dMonth,dYear);
    ddt.printDischargeDate();

    BillType bt(mcharge,dfee,rcharges);
    bt.printBill();
    }
    retransform 0;
    }