Home / Expert Answers / Computer Science / in-c-design-various-classes-and-write-a-program-to-computerize-the-billing-system-of-a-hospital-pa799

(Solved): in C++, design various classes and write a program to computerize the billing system of a hospital. ...



in C++,

design various classes and write a program to
computerize the billing system of a hospital.
a. Design the classdoctorType, inherited from the classpersonType,
defined in Chapter 10, with an additional data member to store a

doctor’s speciality. Add appropriate constructors and member func-
tions 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 construc-
tors and member functions to initialize, access, and manipulate the

data members.
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.
d. Write a program to test your classes.



We have an Answer from Expert

View Expert Answer

Expert Answer



Here's an example implementation of the classes you described in C++:
sub question a) and b)





In this example, the doctorType class is derived from the personType class. It adds an additional data member speciality to store the doctor's specialty. The billType class is used to store a patient's ID and various hospital charges.

In the main function, an instance of the doctorType class named doctor is created and initialized with a first name, last name, and specialty. Similarly, an instance of the billType class named bill is created and initialized with a patient ID and various charges.



The main function then demonstrates how to access the data members of the doctorType and billType objects using the getter functions. It prints out the doctor's name, specialty, patient ID, pharmacy charges, doctor's fee, and room charges.


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe