Problem: Patient Fees C++
You are to write a program that computes a patient’s bill for a hospital stay. The different components of the program are
The PatientAccount class
The Surgery class
The Pharmacy class
The main program
#include <iostream>
#include <string>
using namespace std;
class PatientAccount
{
private:
float dailyprice;
int patientNo;
int days;
string name_of_patient;
public:
PatientAccount(float, int, int,
string);
float getdailyprice();
int getpatientNo();
int getDays();
string getname_of_patient();
void getPatientDisplay(float&
totalCost);
};
PatientAccount::PatientAccount(float dr = 0, int pnum = 0, int
dy = 0, string pn = " ")
{
dailyprice = dr;
patientNo = pnum;
days = dy;
name_of_patient = pn;
}
float PatientAccount::getdailyprice()
{
cout << "Enter the daily price for each day in
the hospital: Rs";
cin >> dailyprice;
return dailyprice;
}
int PatientAccount::getpatientNo()
{
cout << "Enter the patients_number: ";
cin >> patientNo;
return patientNo;
}
int PatientAccount::getDays()
{
cout << "Enter the no of days spent in the
hospital: ";
cin >> days;
return days;
}
string PatientAccount::getname_of_patient()
{
cout << "Enter the patients name: ";
getline(cin, name_of_patient);
return name_of_patient;
}
class Surgery
{
private:
float surgeryCost;
string surgeryType;
public:
Surgery(float, string);
float getCost();
string getSurgeryType();
void getSurgeryDisplay(float&
cost1);
};
Surgery::Surgery(float co = 0, string st = " ")
{
surgeryType = st;
surgeryCost = co;
}
string Surgery::getSurgeryType()
{
cout << "Enter the surgery type \n";
cout << "a. Arm Surgery" << endl;
cout << "b. Hip Surgery" << endl;
cout << "c. Leg Surgery" << endl;
cout << "d. Knee Surgery" << endl;
cout << "e. Neck Surgery" << endl;
cout << "f. Other" << endl;
cin >> surgeryType;
return surgeryType;
}
float Surgery::getCost()
{
if(surgeryType == "a")
{
surgeryCost = 45000;
}
if(surgeryType == "b")
{
surgeryCost = 25000;
}
if(surgeryType == "c")
{
surgeryCost = 65000;
}
if(surgeryType == "d")
{
surgeryCost = 75000;
}
if(surgeryType == "e")
{
surgeryCost = 15000;
}
if(surgeryType == "f")
{
cout << "Enter the name of the surgery :";
cin >> surgeryType;
cout << "Enter the total price of surgery:
Rs";
cin >> surgeryCost;
return surgeryCost;
}
}
class Pharmacy
{
private:
float medCost;
string medName;
public:
Pharmacy(float, string);
float getMedCost();
string getMedtype();
void getPharmacyDisplay(float&
cost2);
};
Pharmacy::Pharmacy(float mc = 0, string mn = " ")
{
medCost = mc;
medName = mn;
};
string Pharmacy::getMedtype()
{cout << "Enter the medicine type \n";
cout << "1. Paracetmol" << endl;
cout << "2. BP medicine" << endl;
cout << "3. Cold medicine" << endl;
cout << "4. Isocapsule" << endl;
cout << "5. Dcold" << endl;
cout << "6. Other" << endl;
cin >> medName;
return medName;
}
float Pharmacy::getMedCost()
{
if(medName == "1")
{
medCost = 100;
}
if(medName == "2")
{
medCost = 86;
}
if(medName == "3")
{
medCost = 30;
}
if(medName == "4")
{
medCost = 156;
}
if(medName == "5")
{
medCost = 410;
}
if(medName == "6")
{
cout << "Enter the name of the medicine
:";
cin >> medName;
cout << "Enter the total cost of medicine:
Rs";
cin >> medCost;
return medCost;
}
}
void PatientAccount::getPatientDisplay(float&
totalCost)
{
PatientAccount patient(getdailyprice(),
getpatientNo(), getDays(), getname_of_patient());
totalCost = days * dailyprice;
cout << "\n";
cout << "Patient Name: " <<
name_of_patient << endl;
cout << "Patient Number: " << patientNo
<< endl;
cout << "Days: " << days <<
endl;
cout << "Daily Rate: Rs" << dailyprice
<< endl;
cout << "Total Cost: Rs" << totalCost
<< endl;
cout << "\n";
}
void Surgery::getSurgeryDisplay(float& cost1)
{
Surgery patient(getCost(), getSurgeryType());
cost1 = surgeryCost;
cout << "Surgery Type: " << surgeryType
<< endl;
cout << "Surgery Cost: Rs" << surgeryCost
<< endl;
cout << "Total Cost: Rs" << cost1 <<
endl;
cout << "\n";
}
void Pharmacy::getPharmacyDisplay(float& cost2)
{
Pharmacy patient(getMedCost(), getMedtype());
cost2 = medCost;
cout << "Medication Name: " << medName
<< endl;
cout << "Medication Cost: Rs" << medCost
<< endl;
cout << "Total Cost: Rs" << cost2 <<
endl;
cout << "\n";
}
int main()
{
float totalCost, cost1, cost2, cost3;
PatientAccount patient;
Surgery patient1;
Pharmacy patient2;
patient.getPatientDisplay(totalCost);
patient1.getSurgeryDisplay(cost1);
patient2.getPharmacyDisplay(cost2);
cost3 = ((totalCost + cost1) + cost2);
cout << "Total Cost Hospital: Rs" << cost3
<< endl;
cout << "\n";
cout << endl << "Press ENTER to
exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

#include <iostream>
#include <string>
using namespace std;
class PatientAccount
{
private:
float dailyprice;
int patientNo;
int days;
string name_of_patient;
public:
PatientAccount(float, int, int,
string);
float getdailyprice();
int getpatientNo();
int getDays();
string getname_of_patient();
void getPatientDisplay(float&
totalCost);
};
PatientAccount::PatientAccount(float dr = 0, int pnum = 0, int
dy = 0, string pn = " ")
{
dailyprice = dr;
patientNo = pnum;
days = dy;
name_of_patient = pn;
}
float PatientAccount::getdailyprice()
{
cout << "Enter the daily price for each day in
the hospital: Rs";
cin >> dailyprice;
return dailyprice;
}
int PatientAccount::getpatientNo()
{
cout << "Enter the patients_number: ";
cin >> patientNo;
return patientNo;
}
int PatientAccount::getDays()
{
cout << "Enter the no of days spent in the
hospital: ";
cin >> days;
return days;
}
string PatientAccount::getname_of_patient()
{
cout << "Enter the patients name: ";
getline(cin, name_of_patient);
return name_of_patient;
}
class Surgery
{
private:
float surgeryCost;
string surgeryType;
public:
Surgery(float, string);
float getCost();
string getSurgeryType();
void getSurgeryDisplay(float&
cost1);
};
Surgery::Surgery(float co = 0, string st = " ")
{
surgeryType = st;
surgeryCost = co;
}
string Surgery::getSurgeryType()
{
cout << "Enter the surgery type \n";
cout << "a. Arm Surgery" << endl;
cout << "b. Hip Surgery" << endl;
cout << "c. Leg Surgery" << endl;
cout << "d. Knee Surgery" << endl;
cout << "e. Neck Surgery" << endl;
cout << "f. Other" << endl;
cin >> surgeryType;
return surgeryType;
}
float Surgery::getCost()
{
if(surgeryType == "a")
{
surgeryCost = 45000;
}
if(surgeryType == "b")
{
surgeryCost = 25000;
}
if(surgeryType == "c")
{
surgeryCost = 65000;
}
if(surgeryType == "d")
{
surgeryCost = 75000;
}
if(surgeryType == "e")
{
surgeryCost = 15000;
}
if(surgeryType == "f")
{
cout << "Enter the name of the surgery :";
cin >> surgeryType;
cout << "Enter the total price of surgery:
Rs";
cin >> surgeryCost;
return surgeryCost;
}
}
class Pharmacy
{
private:
float medCost;
string medName;
public:
Pharmacy(float, string);
float getMedCost();
string getMedtype();
void getPharmacyDisplay(float&
cost2);
};
Pharmacy::Pharmacy(float mc = 0, string mn = " ")
{
medCost = mc;
medName = mn;
};
string Pharmacy::getMedtype()
{cout << "Enter the medicine type \n";
cout << "1. Paracetmol" << endl;
cout << "2. BP medicine" << endl;
cout << "3. Cold medicine" << endl;
cout << "4. Isocapsule" << endl;
cout << "5. Dcold" << endl;
cout << "6. Other" << endl;
cin >> medName;
return medName;
}
float Pharmacy::getMedCost()
{
if(medName == "1")
{
medCost = 100;
}
if(medName == "2")
{
medCost = 86;
}
if(medName == "3")
{
medCost = 30;
}
if(medName == "4")
{
medCost = 156;
}
if(medName == "5")
{
medCost = 410;
}
if(medName == "6")
{
cout << "Enter the name of the medicine
:";
cin >> medName;
cout << "Enter the total cost of medicine:
Rs";
cin >> medCost;
return medCost;
}
}
void PatientAccount::getPatientDisplay(float&
totalCost)
{
PatientAccount patient(getdailyprice(),
getpatientNo(), getDays(), getname_of_patient());
totalCost = days * dailyprice;
cout << "\n";
cout << "Patient Name: " <<
name_of_patient << endl;
cout << "Patient Number: " << patientNo
<< endl;
cout << "Days: " << days <<
endl;
cout << "Daily Rate: Rs" << dailyprice
<< endl;
cout << "Total Cost: Rs" << totalCost
<< endl;
cout << "\n";
}
void Surgery::getSurgeryDisplay(float& cost1)
{
Surgery patient(getCost(), getSurgeryType());
cost1 = surgeryCost;
cout << "Surgery Type: " << surgeryType
<< endl;
cout << "Surgery Cost: Rs" << surgeryCost
<< endl;
cout << "Total Cost: Rs" << cost1 <<
endl;
cout << "\n";
}
void Pharmacy::getPharmacyDisplay(float& cost2)
{
Pharmacy patient(getMedCost(), getMedtype());
cost2 = medCost;
cout << "Medication Name: " << medName
<< endl;
cout << "Medication Cost: Rs" << medCost
<< endl;
cout << "Total Cost: Rs" << cost2 <<
endl;
cout << "\n";
}
int main()
{
float totalCost, cost1, cost2, cost3;
PatientAccount patient;
Surgery patient1;
Pharmacy patient2;
patient.getPatientDisplay(totalCost);
patient1.getSurgeryDisplay(cost1);
patient2.getPharmacyDisplay(cost2);
cost3 = ((totalCost + cost1) + cost2);
cout << "Total Cost Hospital: Rs" << cost3
<< endl;
cout << "\n";
cout << endl << "Press ENTER to
exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

#include <iostream>
#include <string>
using namespace std;
class PatientAccount
{
private:
float dailyprice;
int patientNo;
int days;
string name_of_patient;
public:
PatientAccount(float, int, int,
string);
float getdailyprice();
int getpatientNo();
int getDays();
string getname_of_patient();
void getPatientDisplay(float&
totalCost);
};
PatientAccount::PatientAccount(float dr = 0, int pnum = 0, int
dy = 0, string pn = " ")
{
dailyprice = dr;
patientNo = pnum;
days = dy;
name_of_patient = pn;
}
float PatientAccount::getdailyprice()
{
cout << "Enter the daily price for each day in
the hospital: Rs";
cin >> dailyprice;
return dailyprice;
}
int PatientAccount::getpatientNo()
{
cout << "Enter the patients_number: ";
cin >> patientNo;
return patientNo;
}
int PatientAccount::getDays()
{
cout << "Enter the no of days spent in the
hospital: ";
cin >> days;
return days;
}
string PatientAccount::getname_of_patient()
{
cout << "Enter the patients name: ";
getline(cin, name_of_patient);
return name_of_patient;
}
class Surgery
{
private:
float surgeryCost;
string surgeryType;
public:
Surgery(float, string);
float getCost();
string getSurgeryType();
void getSurgeryDisplay(float&
cost1);
};
Surgery::Surgery(float co = 0, string st = " ")
{
surgeryType = st;
surgeryCost = co;
}
string Surgery::getSurgeryType()
{
cout << "Enter the surgery type \n";
cout << "a. Arm Surgery" << endl;
cout << "b. Hip Surgery" << endl;
cout << "c. Leg Surgery" << endl;
cout << "d. Knee Surgery" << endl;
cout << "e. Neck Surgery" << endl;
cout << "f. Other" << endl;
cin >> surgeryType;
return surgeryType;
}
float Surgery::getCost()
{
if(surgeryType == "a")
{
surgeryCost = 45000;
}
if(surgeryType == "b")
{
surgeryCost = 25000;
}
if(surgeryType == "c")
{
surgeryCost = 65000;
}
if(surgeryType == "d")
{
surgeryCost = 75000;
}
if(surgeryType == "e")
{
surgeryCost = 15000;
}
if(surgeryType == "f")
{
cout << "Enter the name of the surgery :";
cin >> surgeryType;
cout << "Enter the total price of surgery:
Rs";
cin >> surgeryCost;
return surgeryCost;
}
}
class Pharmacy
{
private:
float medCost;
string medName;
public:
Pharmacy(float, string);
float getMedCost();
string getMedtype();
void getPharmacyDisplay(float&
cost2);
};
Pharmacy::Pharmacy(float mc = 0, string mn = " ")
{
medCost = mc;
medName = mn;
};
string Pharmacy::getMedtype()
{cout << "Enter the medicine type \n";
cout << "1. Paracetmol" << endl;
cout << "2. BP medicine" << endl;
cout << "3. Cold medicine" << endl;
cout << "4. Isocapsule" << endl;
cout << "5. Dcold" << endl;
cout << "6. Other" << endl;
cin >> medName;
return medName;
}
float Pharmacy::getMedCost()
{
if(medName == "1")
{
medCost = 100;
}
if(medName == "2")
{
medCost = 86;
}
if(medName == "3")
{
medCost = 30;
}
if(medName == "4")
{
medCost = 156;
}
if(medName == "5")
{
medCost = 410;
}
if(medName == "6")
{
cout << "Enter the name of the medicine
:";
cin >> medName;
cout << "Enter the total cost of medicine:
Rs";
cin >> medCost;
return medCost;
}
}
void PatientAccount::getPatientDisplay(float&
totalCost)
{
PatientAccount patient(getdailyprice(),
getpatientNo(), getDays(), getname_of_patient());
totalCost = days * dailyprice;
cout << "\n";
cout << "Patient Name: " <<
name_of_patient << endl;
cout << "Patient Number: " << patientNo
<< endl;
cout << "Days: " << days <<
endl;
cout << "Daily Rate: Rs" << dailyprice
<< endl;
cout << "Total Cost: Rs" << totalCost
<< endl;
cout << "\n";
}
void Surgery::getSurgeryDisplay(float& cost1)
{
Surgery patient(getCost(), getSurgeryType());
cost1 = surgeryCost;
cout << "Surgery Type: " << surgeryType
<< endl;
cout << "Surgery Cost: Rs" << surgeryCost
<< endl;
cout << "Total Cost: Rs" << cost1 <<
endl;
cout << "\n";
}
void Pharmacy::getPharmacyDisplay(float& cost2)
{
Pharmacy patient(getMedCost(), getMedtype());
cost2 = medCost;
cout << "Medication Name: " << medName
<< endl;
cout << "Medication Cost: Rs" << medCost
<< endl;
cout << "Total Cost: Rs" << cost2 <<
endl;
cout << "\n";
}
int main()
{
float totalCost, cost1, cost2, cost3;
PatientAccount patient;
Surgery patient1;
Pharmacy patient2;
patient.getPatientDisplay(totalCost);
patient1.getSurgeryDisplay(cost1);
patient2.getPharmacyDisplay(cost2);
cost3 = ((totalCost + cost1) + cost2);
cout << "Total Cost Hospital: Rs" << cost3
<< endl;
cout << "\n";
cout << endl << "Press ENTER to
exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

#include <iostream>
#include <string>
using namespace std;
class PatientAccount
{
private:
float dailyprice;
int patientNo;
int days;
string name_of_patient;
public:
PatientAccount(float, int, int,
string);
float getdailyprice();
int getpatientNo();
int getDays();
string getname_of_patient();
void getPatientDisplay(float&
totalCost);
};
PatientAccount::PatientAccount(float dr = 0, int pnum = 0, int
dy = 0, string pn = " ")
{
dailyprice = dr;
patientNo = pnum;
days = dy;
name_of_patient = pn;
}
float PatientAccount::getdailyprice()
{
cout << "Enter the daily price for each day in
the hospital: Rs";
cin >> dailyprice;
return dailyprice;
}
int PatientAccount::getpatientNo()
{
cout << "Enter the patients_number: ";
cin >> patientNo;
return patientNo;
}
int PatientAccount::getDays()
{
cout << "Enter the no of days spent in the
hospital: ";
cin >> days;
return days;
}
string PatientAccount::getname_of_patient()
{
cout << "Enter the patients name: ";
getline(cin, name_of_patient);
return name_of_patient;
}
class Surgery
{
private:
float surgeryCost;
string surgeryType;
public:
Surgery(float, string);
float getCost();
string getSurgeryType();
void getSurgeryDisplay(float&
cost1);
};
Surgery::Surgery(float co = 0, string st = " ")
{
surgeryType = st;
surgeryCost = co;
}
string Surgery::getSurgeryType()
{
cout << "Enter the surgery type \n";
cout << "a. Arm Surgery" << endl;
cout << "b. Hip Surgery" << endl;
cout << "c. Leg Surgery" << endl;
cout << "d. Knee Surgery" << endl;
cout << "e. Neck Surgery" << endl;
cout << "f. Other" << endl;
cin >> surgeryType;
return surgeryType;
}
float Surgery::getCost()
{
if(surgeryType == "a")
{
surgeryCost = 45000;
}
if(surgeryType == "b")
{
surgeryCost = 25000;
}
if(surgeryType == "c")
{
surgeryCost = 65000;
}
if(surgeryType == "d")
{
surgeryCost = 75000;
}
if(surgeryType == "e")
{
surgeryCost = 15000;
}
if(surgeryType == "f")
{
cout << "Enter the name of the surgery :";
cin >> surgeryType;
cout << "Enter the total price of surgery:
Rs";
cin >> surgeryCost;
return surgeryCost;
}
}
class Pharmacy
{
private:
float medCost;
string medName;
public:
Pharmacy(float, string);
float getMedCost();
string getMedtype();
void getPharmacyDisplay(float&
cost2);
};
Pharmacy::Pharmacy(float mc = 0, string mn = " ")
{
medCost = mc;
medName = mn;
};
string Pharmacy::getMedtype()
{cout << "Enter the medicine type \n";
cout << "1. Paracetmol" << endl;
cout << "2. BP medicine" << endl;
cout << "3. Cold medicine" << endl;
cout << "4. Isocapsule" << endl;
cout << "5. Dcold" << endl;
cout << "6. Other" << endl;
cin >> medName;
return medName;
}
float Pharmacy::getMedCost()
{
if(medName == "1")
{
medCost = 100;
}
if(medName == "2")
{
medCost = 86;
}
if(medName == "3")
{
medCost = 30;
}
if(medName == "4")
{
medCost = 156;
}
if(medName == "5")
{
medCost = 410;
}
if(medName == "6")
{
cout << "Enter the name of the medicine
:";
cin >> medName;
cout << "Enter the total cost of medicine:
Rs";
cin >> medCost;
return medCost;
}
}
void PatientAccount::getPatientDisplay(float&
totalCost)
{
PatientAccount patient(getdailyprice(),
getpatientNo(), getDays(), getname_of_patient());
totalCost = days * dailyprice;
cout << "\n";
cout << "Patient Name: " <<
name_of_patient << endl;
cout << "Patient Number: " << patientNo
<< endl;
cout << "Days: " << days <<
endl;
cout << "Daily Rate: Rs" << dailyprice
<< endl;
cout << "Total Cost: Rs" << totalCost
<< endl;
cout << "\n";
}
void Surgery::getSurgeryDisplay(float& cost1)
{
Surgery patient(getCost(), getSurgeryType());
cost1 = surgeryCost;
cout << "Surgery Type: " << surgeryType
<< endl;
cout << "Surgery Cost: Rs" << surgeryCost
<< endl;
cout << "Total Cost: Rs" << cost1 <<
endl;
cout << "\n";
}
void Pharmacy::getPharmacyDisplay(float& cost2)
{
Pharmacy patient(getMedCost(), getMedtype());
cost2 = medCost;
cout << "Medication Name: " << medName
<< endl;
cout << "Medication Cost: Rs" << medCost
<< endl;
cout << "Total Cost: Rs" << cost2 <<
endl;
cout << "\n";
}
int main()
{
float totalCost, cost1, cost2, cost3;
PatientAccount patient;
Surgery patient1;
Pharmacy patient2;
patient.getPatientDisplay(totalCost);
patient1.getSurgeryDisplay(cost1);
patient2.getPharmacyDisplay(cost2);
cost3 = ((totalCost + cost1) + cost2);
cout << "Total Cost Hospital: Rs" << cost3
<< endl;
cout << "\n";
cout << endl << "Press ENTER to
exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

#include <iostream>
#include <string>
using namespace std;
class PatientAccount
{
private:
float dailyprice;
int patientNo;
int days;
string name_of_patient;
public:
PatientAccount(float, int, int,
string);
float getdailyprice();
int getpatientNo();
int getDays();
string getname_of_patient();
void getPatientDisplay(float&
totalCost);
};
PatientAccount::PatientAccount(float dr = 0, int pnum = 0, int
dy = 0, string pn = " ")
{
dailyprice = dr;
patientNo = pnum;
days = dy;
name_of_patient = pn;
}
float PatientAccount::getdailyprice()
{
cout << "Enter the daily price for each day in
the hospital: Rs";
cin >> dailyprice;
return dailyprice;
}
int PatientAccount::getpatientNo()
{
cout << "Enter the patients_number: ";
cin >> patientNo;
return patientNo;
}
int PatientAccount::getDays()
{
cout << "Enter the no of days spent in the
hospital: ";
cin >> days;
return days;
}
string PatientAccount::getname_of_patient()
{
cout << "Enter the patients name: ";
getline(cin, name_of_patient);
return name_of_patient;
}
class Surgery
{
private:
float surgeryCost;
string surgeryType;
public:
Surgery(float, string);
float getCost();
string getSurgeryType();
void getSurgeryDisplay(float&
cost1);
};
Surgery::Surgery(float co = 0, string st = " ")
{
surgeryType = st;
surgeryCost = co;
}
string Surgery::getSurgeryType()
{
cout << "Enter the surgery type \n";
cout << "a. Arm Surgery" << endl;
cout << "b. Hip Surgery" << endl;
cout << "c. Leg Surgery" << endl;
cout << "d. Knee Surgery" << endl;
cout << "e. Neck Surgery" << endl;
cout << "f. Other" << endl;
cin >> surgeryType;
return surgeryType;
}
float Surgery::getCost()
{
if(surgeryType == "a")
{
surgeryCost = 45000;
}
if(surgeryType == "b")
{
surgeryCost = 25000;
}
if(surgeryType == "c")
{
surgeryCost = 65000;
}
if(surgeryType == "d")
{
surgeryCost = 75000;
}
if(surgeryType == "e")
{
surgeryCost = 15000;
}
if(surgeryType == "f")
{
cout << "Enter the name of the surgery :";
cin >> surgeryType;
cout << "Enter the total price of surgery:
Rs";
cin >> surgeryCost;
return surgeryCost;
}
}
class Pharmacy
{
private:
float medCost;
string medName;
public:
Pharmacy(float, string);
float getMedCost();
string getMedtype();
void getPharmacyDisplay(float&
cost2);
};
Pharmacy::Pharmacy(float mc = 0, string mn = " ")
{
medCost = mc;
medName = mn;
};
string Pharmacy::getMedtype()
{cout << "Enter the medicine type \n";
cout << "1. Paracetmol" << endl;
cout << "2. BP medicine" << endl;
cout << "3. Cold medicine" << endl;
cout << "4. Isocapsule" << endl;
cout << "5. Dcold" << endl;
cout << "6. Other" << endl;
cin >> medName;
return medName;
}
float Pharmacy::getMedCost()
{
if(medName == "1")
{
medCost = 100;
}
if(medName == "2")
{
medCost = 86;
}
if(medName == "3")
{
medCost = 30;
}
if(medName == "4")
{
medCost = 156;
}
if(medName == "5")
{
medCost = 410;
}
if(medName == "6")
{
cout << "Enter the name of the medicine
:";
cin >> medName;
cout << "Enter the total cost of medicine:
Rs";
cin >> medCost;
return medCost;
}
}
void PatientAccount::getPatientDisplay(float&
totalCost)
{
PatientAccount patient(getdailyprice(),
getpatientNo(), getDays(), getname_of_patient());
totalCost = days * dailyprice;
cout << "\n";
cout << "Patient Name: " <<
name_of_patient << endl;
cout << "Patient Number: " << patientNo
<< endl;
cout << "Days: " << days <<
endl;
cout << "Daily Rate: Rs" << dailyprice
<< endl;
cout << "Total Cost: Rs" << totalCost
<< endl;
cout << "\n";
}
void Surgery::getSurgeryDisplay(float& cost1)
{
Surgery patient(getCost(), getSurgeryType());
cost1 = surgeryCost;
cout << "Surgery Type: " << surgeryType
<< endl;
cout << "Surgery Cost: Rs" << surgeryCost
<< endl;
cout << "Total Cost: Rs" << cost1 <<
endl;
cout << "\n";
}
void Pharmacy::getPharmacyDisplay(float& cost2)
{
Pharmacy patient(getMedCost(), getMedtype());
cost2 = medCost;
cout << "Medication Name: " << medName
<< endl;
cout << "Medication Cost: Rs" << medCost
<< endl;
cout << "Total Cost: Rs" << cost2 <<
endl;
cout << "\n";
}
int main()
{
float totalCost, cost1, cost2, cost3;
PatientAccount patient;
Surgery patient1;
Pharmacy patient2;
patient.getPatientDisplay(totalCost);
patient1.getSurgeryDisplay(cost1);
patient2.getPharmacyDisplay(cost2);
cost3 = ((totalCost + cost1) + cost2);
cout << "Total Cost Hospital: Rs" << cost3
<< endl;
cout << "\n";
cout << endl << "Press ENTER to
exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}

Problem: Patient Fees C++ You are to write a program that computes a patient’s bill for...
Write a python program that computes a patients bill for a hospital stay. The different components of the program are The patientAccount class The Surgery class The Pharmacy class The main program -The PatientAccount class will keep a total of the patient's charges. It will also keep track of the number of days spent in the hospital. The group must decide on the hospital's daily rate. -The Surgery class will have stored within it the charges for at least five...
Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital Medication Charges Charges for hospital services (labs, tests, etc.) The program should ask for the following data if the patient was an out-patient: Charges for hospital...
Python language please (also upload the result pic too) Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient the following data should be entered: • The number of days spent in the hospital • The daily rate • Charges for hospital services (lab tests, etc.) • Hospital medication charges. If the patient was...
C++
Write a program that computes and displays the charges for a patient's hospital stay_First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab...
program Java oop
The project description As a programmer; you have been asked to write a program for a Hospital with the following The Hospital has several employees and each one of them has an ID, name, address, mobile number, email and salary. . The employees are divided into Administration staff: who have in addition to the previous information their position. Nurse: who have their rank and specialty stored in addition to the previous o o Doctor: who have the...
program Java oop
The project description As a programmer; you have been asked to write a program for a Hospital with the following The Hospital has several employees and each one of them has an ID, name, address, mobile number, email and salary. . The employees are divided into Administration staff: who have in addition to the previous information their position. Nurse: who have their rank and specialty stored in addition to the previous o o Doctor: who have the...
C++ language Please help. Create a small hospital system, where patients can book appointments. The program should be able to take a patient’s information and the appointment that they’d like to book. It should also be able to display the patients names in order of their appointments (ascendingly). Your program should consist of: Class Person: with private variables name, ID and age. A default and a copy constructor, setters and getters and a print function. Class Patient: inherits from Person....
You will write a C program, q1 sequence.c, that computes the value of the nth term in any recursive sequence with the following structure: an = c1 · an−1 + c2 · an−2 a0 > 0 a1 > 0 c1 6= 0 c2 6= 0 Your C program will take 5 integer arguments on the command line: n, a0, a1, c1 and c2. n must be an integer greater than or equal to 0. If more or fewer arguments are...
C++ Write a program that reads students’ names followed by their test scores from the given input file. The program should output to a file, output.txt, each student’s name followed by the test scores and the relevant grade. Student data should be stored in a struct variable of type StudentType, which has four components: studentFName and studentLName of type string, testScore of type int and grade of type char. Suppose that the class has 20 students. Use an array of...
If your program does not compile, you will not receive any points! You will write a program to keep up with a Jewelry store and some of the Inventory (rings/necklaces/earrings) purchased there (The Jewelry store can be real or not) using Object-Oriented Programming (OOP). The important aspect of object-oriented programming is modular development and testing of reusable software modules. You love selling rings, necklaces, and earrings as well as programming and have decided to open a Jewelry store. To save...