Design various classes and write a program to computerize the billing system of a hospital.
Design the class doctor Type, inherited from the class personType, defined in Chapter 10, with
an additional data member to store a doctor\'s specialty. Add appropriate constructors and
member functions to initialize, access, and manipulate the data members. Design the class bill
Type 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. 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. Write a program to
test your classes.
Solution
Please find the code for the given problem with required classes
//billType.cpp
#include \"billType.h\"
billType::billType(int ID, double Med, double pDrF, double room_Charge)
{
PtID = ID;
MedChg = Med;
DrF = pDrF;
RmChg = room_Charge;
}
void billType::setMedChg(double Med)
{
MedChg = Med;
}
double billType::getMedChg() const
{
return MedChg;
}
void billType::setDrF(double pDrF)
{
DrF = pDrF;
}
double billType::getDrF() const
{
return DrF;
}
void billType::setRmChg(double pRmChg)
{
RmChg = pRmChg;
}
double billType::getRmChg() const
{
return RmChg;
}
//billType.h
#ifndef billType_H
#define billType_H
#include
#include
using namespace std;
class billType
{
private :
int PtID;
double MedChg;
double DrF;
double RmChg;
public:
billType(int PtID = 0, double MedChg = 0, double DrF = 0, double RmChg = 0);
void setMedChg(double MedChg);
double getMedChg() const;
void setDrF(double DrF);
double getDrF() const;
void setRmChg(double RmChg);
double getRmChg() const;
};
#endif billType_H
//dateType.cpp
#include
#include \"dateType.h\"
using namespace std;
void dateType::setDate(int Month, int Day, int Year)
{
nMnth = Month;
nDay = Day;
nYr = Year;
}
int dateType::getDay() const
{
return nDay;
}
int dateType::getMonth() const
{
return nMnth;
}
int dateType::getYear() const
{
return nYr;
}
void dateType::printDate() const
{
cout << nMnth << \"-\" << nDay << \"-\" << nYr;
}
//Constructor with parameters
dateType::dateType(int Month, int Day, int Year)
{
nMnth = Month;
nDay = Day;
nYr = Year;
}
//dateType.h
#ifndef dateType_H
#define dateType_H
class dateType
{
public:
void setDate(int Month, int Day, int Year);
int getDay() const;
int getMonth() const;
int getYear() const;
void printDate() const;
dateType(int Month = 1, int Day = 1, .
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Design various classes and write a program to computerize the billing.pdf
1. Design various classes and write a program to computerize the billing system of a hospital.
Design the class doctor Type, inherited from the class personType, defined in Chapter 10, with
an additional data member to store a doctor's specialty. Add appropriate constructors and
member functions to initialize, access, and manipulate the data members. Design the class bill
Type 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. 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. Write a program to
test your classes.
Solution
Please find the code for the given problem with required classes
//billType.cpp
#include "billType.h"
billType::billType(int ID, double Med, double pDrF, double room_Charge)
{
PtID = ID;
MedChg = Med;
DrF = pDrF;
RmChg = room_Charge;
}
void billType::setMedChg(double Med)
{
MedChg = Med;
}
double billType::getMedChg() const
{
return MedChg;
}
void billType::setDrF(double pDrF)