Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C + + help with main.cpp Instructions Design the class doctorType, inherited from the class personType, defined in Chapter 1 0 , with an additional
C help with main.cpp
Instructions
Design the class doctorType, inherited from the class personType, defined in Chapter with an additional data member to store a doctors specialty. Add appropriate constructors and member functions to initialize, access, and manipulate the data members.
Design the class billType with data members to store a patients ID and a patients hospital charges, such as pharmacy charges for medicine, doctors fee, and room charges. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. If no value is provided for a charge, it should default to
Design the class patientType, inherited from the class personType, defined in Chapter with additional data members to store a patients ID age, date of birth, attending physicians 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 physicians name. Add appropriate constructors and member functions to initialize, access, and manipulate the data members.
Be careful! The dateType object and the patientType object might accept different date formats.
Write a program to test your classes.
I am trying to write a main.cpp for this assignment but I keep getting into problems with it I will put down below the four h files for help, There might be empty spots on the #include though so if that happens I will try to resend the question if it is an issue. Make sure yours is runnable.
billType.h
#ifndef HbillType
#define HbillType
#include "doctorType.h
#include "personType.h
#include "dateType.h
#include
using namespace std;
class billType
public:
void printBill const;
void setInfostring id double phCharges double rRent double docFee ;
void setIDstring id;
string getID const;
void setPharmacyChargesdouble charges ;
double getPharmacyCharges const;
void updatePharmacyChargesdouble charges ;
void setRoomRentdouble charges ;
double getRoomRent const;
void updateRoomRentdouble charges ;
void setDoctorFeedouble charges ;
double getDoctorFee const;
void updateDoctorFeedouble charges ;
double billingAmount const;
billTypestring id double phCharges double rRent double docFee ;
private:
string ID;
double pharmacyCharges;
double roomRent;
double doctorFee;
;
#endif
dateType.h
#ifndef HdateType
#define HdateType
#include
using namespace std;
class dateType
public:
void setDateint month, int day, int year;
int getMonth const;
int getDay const;
int getYear const;
void printDate const;
dateTypeint month int day int year ;
private:
int dMonth;
int dDay;
int dYear;
;
#endif
doctorType.h
#ifndef HdoctorType
#define HdoctorType
#include "personType.h
#include
using namespace std;
class doctorType : public personType
public:
void setSpecialtystring specialty;
string getSpecialty const;
doctorTypestring first string last string specialty ;
private:
string specialty;
;
#endif
patientType.h
#ifndef HpatientType
#define HpatientType
#include "personType.h
#include "dateType.h
#include "billType.h
#include "doctorType.h
#include
using namespace std;
class patientType : public personType
public:
void setPatientInfostring id int age dateType dob dateType
string physician dateType admitDate dateType dateType dischargeDate dateType
double phCharges double rRent double docFee ;
void setIDstring id;
string getID const;
void setAgeint age;
int getAge const;
void setDateOfBirthint month, int day, int year;
dateType getDateOfBirth const;
void setAttendingPhysicianstring physician;
string getAttendingPhysician const;
void setAdmitDateint month, int day, int year;
dateType getAdmitDate const;
void setDischargeDateint month, int day, int year;
dateType getDischargeDate const;
void setBillInfodouble phCharges double rRent double docFee ;
void printPatientInfo const;
double billingAmount const;
patientTypestring id int age dateType dob dateType
string physician dateType admitDate dateType dateType dischargeDate dateType
double phCharges double rRent double docFee ;
private:
string patientID;
int patientAge;
dateType dateOfBirth;
string attendingPhysician;
dateType admissionDate;
dateType dischargeDate;
billType patientBill;
;
#endif
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started