a. Create a personType class with first name and last name as data menbers. Add appropriate constructors and member func
Posted: Thu May 26, 2022 9:42 am
a. Create a personType class with first name and last name as data menbers. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Design the class doctorType, inherited from the class personType, with an additional data member to store a doctor’s speciality. Add appropriate constructors and member functions to initialize, access, and manipulate the data members.
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.
c. Design the class patientType, inherited from the class personType, 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.
Write a program to test your classes.
Reference
Create personType class:
private:
string firstName; //variable to store the first name
string lastName; //variable to store the last name
include constructor,
getter
Setter
get first name, set first name, get last name, set last name, and a printdetails method
def print()
display firstname
display last name
Create an object Person1.
Print should work like in the main
Person1.printdetails()
___________________________________________________________________
Create
DoctorType inherit from PersonType
private:
string speciality
Get specialty, set specialty
Printdetails()
Create DateType
Day, month year, create getter and setters, constructors and print date()
______________________________________________________________________
Create BillType
string ID;
double pharmacyCharges;
double roomRent;
double doctorFee
printBill()
Set ID ,get id, set pharmacy charges, get pharmacy charges, set room rent, get room rent ,set doctor's fee ,get doctors fee ,constructor for billType class and you can have an additional method called billing amount.
In addition to getter and setter, you can have update methods as well.
"Pharmacy Charges: $" << pharmacyCharges << endl;
"Room Charges: $" << roomRent << endl;
"Doctor's Fees: $" << doctorFee << endl;
_____________________________ " << endl;
"Total Charges: $" << pharmacyCharges + roomRent + doctorFee
billingAmount()
{
return pharmacyCharges + roomRent + doctorFee;
}
Create PatientType
private:
string ID;
dateType dateOfBirth;
doctorType attendingPhysicain;
dateType admitDate;
dateType dischargeDate;
print method, constructor. set ID, get ID, set birthdate, set doctor name, set doctor specialty ,get doctor first name, get doctor last name, get doctor specialty ,set admission date, get admission date, set discharge date, get discharge date ,
Main program:
This can be your menu option
1) Enter patient details
Enter patient ID, then call the set ID method of the patient class, and call the set ID method of the bill, then enter the patient's first name, enter patient's last name, and call the set method of the patient class to set the patient detailed,
enter the doctor’s first name, enter the doctor’s last name, and create the doctor object for the patient,
set doctor's specialty, set administrative date, set discharge date set pharmacy charges, set room rent, set doctor's fee ( Put in the bill object) call the print method of the patient class and callprint bill method of the bill class
2) print patient’s medical bill
3) create a list of patients
4) create a list of doctors
5) view list of patients
6) view list of doctors
7) exit
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.
c. Design the class patientType, inherited from the class personType, 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.
Write a program to test your classes.
Reference
Create personType class:
private:
string firstName; //variable to store the first name
string lastName; //variable to store the last name
include constructor,
getter
Setter
get first name, set first name, get last name, set last name, and a printdetails method
def print()
display firstname
display last name
Create an object Person1.
Print should work like in the main
Person1.printdetails()
___________________________________________________________________
Create
DoctorType inherit from PersonType
private:
string speciality
Get specialty, set specialty
Printdetails()
Create DateType
Day, month year, create getter and setters, constructors and print date()
______________________________________________________________________
Create BillType
string ID;
double pharmacyCharges;
double roomRent;
double doctorFee
printBill()
Set ID ,get id, set pharmacy charges, get pharmacy charges, set room rent, get room rent ,set doctor's fee ,get doctors fee ,constructor for billType class and you can have an additional method called billing amount.
In addition to getter and setter, you can have update methods as well.
"Pharmacy Charges: $" << pharmacyCharges << endl;
"Room Charges: $" << roomRent << endl;
"Doctor's Fees: $" << doctorFee << endl;
_____________________________ " << endl;
"Total Charges: $" << pharmacyCharges + roomRent + doctorFee
billingAmount()
{
return pharmacyCharges + roomRent + doctorFee;
}
Create PatientType
private:
string ID;
dateType dateOfBirth;
doctorType attendingPhysicain;
dateType admitDate;
dateType dischargeDate;
print method, constructor. set ID, get ID, set birthdate, set doctor name, set doctor specialty ,get doctor first name, get doctor last name, get doctor specialty ,set admission date, get admission date, set discharge date, get discharge date ,
Main program:
This can be your menu option
1) Enter patient details
Enter patient ID, then call the set ID method of the patient class, and call the set ID method of the bill, then enter the patient's first name, enter patient's last name, and call the set method of the patient class to set the patient detailed,
enter the doctor’s first name, enter the doctor’s last name, and create the doctor object for the patient,
set doctor's specialty, set administrative date, set discharge date set pharmacy charges, set room rent, set doctor's fee ( Put in the bill object) call the print method of the patient class and callprint bill method of the bill class
2) print patient’s medical bill
3) create a list of patients
4) create a list of doctors
5) view list of patients
6) view list of doctors
7) exit