This program is giving me much trouble and need expert assistance to the followi
ID: 3662142 • Letter: T
Question
This program is giving me much trouble and need expert assistance to the following question in c++ "I'm using visual 2010 just a fyi":
In this exercise, you will design various classes and write a program to computerize the billing system of a hospital.
a. Design the class doctorType, inherited from the class personType, defined in Chapter 10, 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.)
appropriate constructors and member functions to initialize, access, and manipulate the data members. Write a program to test your classes.
Explanation / Answer
#include <iostream>
using namespace std;
class personType{
public:
string name;
int age;
time_t dob;
personType(string n,int a,time_t t){
name = n;
age = a;
dob = t;
}
void set_name(string n){
name = n;
}
string get_name(){
return name;
}
void set_age(int a){
age = a;
}
int get_age(){
return age;
}
void set_dob(time_t d){
dob = d;
}
time_t get_dob(){
return dob;
}
};
class doctorType : public personType{
public:
string specialist;
int fee;
doctorType(string n,int a,string s,int f,time_t t) : personType(n,a,t){
specialist = s;
fee = f;
}
void set_spl(string s){
specialist = s;
}
string get_spl(){
return specialist;
}
void set_fee(int f){
fee = f;
}
int get_fee(){
return fee;
}
};
class billType{
public:
string pat_ID;
int bill;
billType(string p,int b){
pat_ID = p;
bill = b;
}
void set_id(string s){
pat_ID = s;
}
string get_id(){
return pat_ID;
}
void set_bill(int b){
bill = b;
}
int get_bill(){
return bill;
}
};
class patientType : public personType{
public:
string pat_ID;
doctorType doc;
time_t visit_date;
patientType(string id,string dc,time_t vd,string n,int a,time_t t) : personType(n,a,t){
pat_ID = id;
doc = dc;
visit_date = vd;
}
void set_id(string s){
pat_ID = s;
}
string get_id(){
return pat_ID;
}
void set_doc(doctorType d){
doc = d;
}
doctorType get_doc(){
return doc;
}
void set_vd(time_t vd){
visit_date = vd;
}
time_t get_vd(){
return visit_date;
}
};
int main(){
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.