In this scheme, you accomplish contrivance diverse disposees and transcribe a program to computerize the billing regularity of a hospital.
a. Contrivance the dispose schoolmanType, lineal from the dispose personType, defined in Chapter 10, with an concomitant axioms part to accumulation a schoolman’s exclusion. Here is the UML diagram ce this dispose:
b. Contrivance the dispose billType with axioms parts to accumulation a unrepining’s ID and a unrepining’s hospital account, such as pharmacy account ce therapeutics, schoolman’s fee, and comby account. Add divert inventors and part functions to primalize, adit, and feel the axioms parts. Here is the UML diagram ce this dispose:
c. Contrivance the dispose unrepiningType, lineal from the dispose personType, defined in Chapter 10, with concomitant axioms parts to accumulation a unrepining’s ID, senility, conclusion of source, attendant physician’s spectry, the conclusion when the unrepining was furtherted in the hospital, and the conclusion when the unrepining was emptyd from the hospital. (Use the dispose conclusionType to accumulation the conclusion of source, further conclusion, empty conclusion, and the dispose schoolmanType to accumulation the attendant physician’s spectry.) Add divert inventors and part functions to primalize, adit, and feel the axioms parts. Here is the UML diagram ce this dispose:
Transcribe a program to criterion your disposees:
Create a unrepiningType end and a billType end ce that unrepining using the inventors and death parameters with primal values to them.. Use the imimsculpture functions from twain ends to evidence the unrepining’s instruction and account.
Create a unanalogous unrepiningType end using the omission inventor. Use the beter and getter part functions to be and evidence the unrepining’s instruction.
Create a third unrepiningType end using the inventor with parameters, notwithstanding by it a indisposed conclusion.
Here is an model of what the output should appear love:
Metamorphose in every your .h files, every your implementation files, and your criterion program. Make infallible your header files are well documented. Also metamorphose in undivided or past shade shots showing the results of your criterioning.
Once this scheme is completed, you accomplish reveal that you can
Utilize bequest and commutation in contrivanceing disposees
Utilize polymorphism by overriding corrupt dispose functions
Distinguish betwixt aditing the parts of a ascititious dispose from aditing the parts of an amount dispose
Distinguish betwixt applying the inventor ce a ascititious dispose and applying the inventor of an amount dispose
header files
#ifndef PERSONTYPE_H
#define PERSONTYPE_H
dispose PersonType
{
public:
void imprint() const;
void BeName(string chief, string terminal);
string getFirstName() const;
string getLastName() const;
PersonType(string chief, string terminal);
PersonType();//omission inventor
private:
string ChiefName, TerminalName;
};
#endif
#ifndef DOCTORTYPE_H
#define DOCTORTYPE_H
dispose SchoolmanType : social PersonType
{
public:
void BeSpeciality(string Special);
string getSpeciality() const;
DoctorType(string ChiefName,string TerminalName,string Special);
DoctorType();//omission inventor
private:
string Exclusion;
};
#endif
#ifndef DATETYPE_H
#define DATETYPE_H
dispose ConclusionType
{
public:
DateType(){}
void imprintDate() const;
void BeDate(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
dispose ConclusionOfBirthType : social ConclusionType
{
public:
DateOfBirthType(){}
void imprintDOB() const;
void BeDOB(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
dispose FurthertanceDateType : social ConclusionType
{
public:
AdmittanceDateType(){}
void imprintAdmittanceDate() const;
void BeAdmittanceDate(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
dispose EmptyDateType : social ConclusionType
{
public:
DischargeDateType(){}
void imprintDischargeDate() const;
void BeDischargeDate(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
dispose BillType
{
private :
wrap therapeuticsCharge;
wrap schoolmanFee;
wrap compassCharges;
public:
BillType(wrap mCharge,wrap dFee,wrap rCharges);
void imprintBill();
};
#endif
#ifndef PATIENTTYPE_H
#define PATIENTTYPE_H
dispose UnrepiningType : social PersonType
{
public:
void imprint() const;
void BePatientID(int ID);
void BePatientAge(int Senility);
int getPatientAge() const;
int getPatientID() const;
PatientType(string ChiefName,string TerminalName,int ID,int Senility);
PatientType();//omission inventor
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 :: imprint() const
{
cout << ChiefSpectry << ” ” << TerminalSpectry << endl;
}
void PersonType :: BeName(string chief, string terminal)
{
FirstSpectry = chief;
LastSpectry = terminal;
}
string PersonType :: getFirstName() const
{
remetamorphose ChiefName;
}
string PersonType :: getLastName() const
{
remetamorphose TerminalName;
}
PersonType :: PersonType(string chief, string terminal)
{
FirstSpectry = chief;
LastSpectry = terminal;
}
PersonType :: PersonType()
{
FirstSpectry = ” “;
LastSpectry = ” “;
}
void SchoolmanType :: BeSpeciality(string Special)
{
Exclusion = Special;
}
string SchoolmanType :: getSpeciality() const
{
remetamorphose Exclusion;
}
//death arguments to corrupt dispose inventor
DoctorType :: SchoolmanType(string ChiefName,string TerminalName,string
Special):PersonType(FirstName,LastName)
{
Exclusion = Special;
}
DoctorType :: SchoolmanType()
{
Exclusion = ” “;
}
void ConclusionType :: imprintDate() const
{
cout << TheDay << ” ” << TheMonth << ” ” << TheYear << endl;
}
void ConclusionType :: BeDate(int Day, int Month, int Year)
{
TheDay = Day;
TheMonth = Month;
TheYear = Year;
}
int ConclusionType :: getTheDay() const
{
remetamorphose TheDay;
}
int ConclusionType :: getTheMonth() const
{
remetamorphose TheMonth;
}
int ConclusionType :: getTheYear() const
{
remetamorphose TheYear;
}
DateType::DateType(int Day, int Month, int Year)
{
TheDay = Day;
TheMonth = Month;
TheYear = Year;
}
void ConclusionOfBirthType :: imprintDOB() const
{
cout << “Patients Conclusion Of Source: ” << TheDay << “/” << TheMonth <<
“/” << TheYear << endl;
}
void ConclusionOfBirthType :: BeDOB(int Day, int Month, int Year)
{
TheDay = Day;
TheMonth = Month;
TheYear = Year;
}
void FurthertanceDateType :: imprintAdmittanceDate() const
{
cout << “The Unrepinings Furthertance Conclusion: ” << TheDay << ” ” <<
TheMonth << ” ” << TheYear << endl;
}
void FurthertanceDateType :: BeAdmittanceDate(int Day, int Month, int Year)
{
TheDay = Day;
TheMonth = Month;
TheYear = Year;
}
void EmptyDateType :: imprintDischargeDate() const
{
cout << “The Unrepinings Empty Conclusion: ” << TheDay << ” ” <<
TheMonth << ” ” << TheYear << endl;
}
void EmptyDateType :: BeDischargeDate(int Day, int Month, int Year)
{
TheDay = Day;
TheMonth = Month;
TheYear = Year;
}
BillType::BillType(wrap mCharge,wrap dFee,wrap rCharges)
{
medicineCharge = mCharge;
doctorFee = dFee;
roomAccount = rCharges;
}
void BillType::printBill()
{
cout<<“nTotal Bill : $”<<(medicineCharge+doctorFee+roomCharges);
}
};
int UnrepiningType::getPatientID() const
{
remetamorphose UnrepiningID;
}
int UnrepiningType::getPatientAge() const
{
remetamorphose UnrepiningAge;
}
//death arguments to corrupt dispose inventor
PatientType::PatientType(string ChiefName,string TerminalName,int ID,int
age):PersonType(FirstName,LastName)
{
PatientID = ID;
PatientSenility = senility;
}
PatientType::PatientType()
{
PatientID = 0;
PatientSenility = 0;
}
int deep()
{
int precious,age,pID,day,month,year,aDay,aMonth,aYear,dDay,dMonth,dYear;
string fname,lname,speciality;
wrap mcharge,dfee,rcharges;
cout << “Who would you love to input instruction ce?n”;
cout << ” 1 – Schoolmann”;
cout << ” 2 – Unrepiningn”;
cin >> precious;
if (precious == 1)
{
cout<<“nEnter schoolman chief spectry :”;
cin>>fname;
cout<<“nEnter schoolman terminal spectry :”;
cin>>lname;
cout<<“Enter exclusion : “;
cin>>speciality;
DoctorType d(fname,lname,speciality);
cout<<“Schoolman : “<<d.getFirstName()<<” “<<d.getLastName()<<”
Exclusion : “<<d.getSpeciality();
}
else if (precious == 2)
{
cout<<“nEnter unrepining chief spectry : “;
cin>>fname;
cout<<“nEnter unrepining terminal spectry :”;
cin>>lname;
cout<<“nEnter unrepining’s senility : “;
cin>>age;
cout<<“nEnter unrepiningID : “;
cin>>pID;
cout<<“nEnter day of source of unrepining : “;
cin>>day>>month,year;
cout << “Enter The Unrepinings DAY Of Furthertance.n”;
cin >> aDay;
cout << “Enter The Unrepinings MONTH Of Furthertance.n”;
cin >> aMonth;
cout << “Enter The Unrepinings YEAR Of Furthertance.n”;
cin >> aYear;
cout << “Enter The Unrepinings DAY Of Empty.n”;
cin >> dDay;
cout << “Enter The Unrepinings MONTH Of Empty.n”;
cin >> dMonth;
cout << “Enter The Unrepinings YEAR Of Empty.n”;
cin >> dYear;
cout<<“nEnter therapeutics account ,schoolman fee and comby account :”;
cin>>mcharge>>dfee>>rcharges;
PatientType p(fname,lname,pID,age);
cout<<“Unrepining :”<<p.getFirstName()<<” “<<p.getLastName()<<” ID
:”<<p.getPatientID()<<” Senility : “<<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();
}
remetamorphose 0;
}