Answered step by step
Verified Expert Solution
Link Copied!

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 10, 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 0.
Design the class patientType, inherited from the class personType, defined in Chapter 10, 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 H_billType
#define H_billType
#include "doctorType.h"
#include "personType.h"
#include "dateType.h"
#include
using namespace std;
class billType
{
public:
void printBill() const;
void setInfo(string id ="", double phCharges =0, double rRent =0, double docFee =0);
void setID(string id);
string getID() const;
void setPharmacyCharges(double charges =0);
double getPharmacyCharges() const;
void updatePharmacyCharges(double charges =0);
void setRoomRent(double charges =0);
double getRoomRent() const;
void updateRoomRent(double charges =0);
void setDoctorFee(double charges =0);
double getDoctorFee() const;
void updateDoctorFee(double charges =0);
double billingAmount() const;
billType(string id ="", double phCharges =0, double rRent =0, double docFee =0);
private:
string ID;
double pharmacyCharges;
double roomRent;
double doctorFee;
};
#endif
dateType.h
#ifndef H_dateType
#define H_dateType
#include
using namespace std;
class dateType
{
public:
void setDate(int month, int day, int year);
int getMonth() const;
int getDay() const;
int getYear() const;
void printDate() const;
dateType(int month =1, int day =1, int year =1900);
private:
int dMonth;
int dDay;
int dYear;
};
#endif
doctorType.h
#ifndef H_doctorType
#define H_doctorType
#include "personType.h"
#include
using namespace std;
class doctorType : public personType
{
public:
void setSpecialty(string specialty);
string getSpecialty() const;
doctorType(string first ="", string last ="", string specialty ="");
private:
string specialty;
};
#endif
patientType.h
#ifndef H_patientType
#define H_patientType
#include "personType.h"
#include "dateType.h"
#include "billType.h"
#include "doctorType.h"
#include
using namespace std;
class patientType : public personType
{
public:
void setPatientInfo(string id ="", int age =0, dateType dob = dateType(),
string physician ="", dateType admitDate = dateType(), dateType dischargeDate = dateType(),
double phCharges =0, double rRent =0, double docFee =0);
void setID(string id);
string getID() const;
void setAge(int age);
int getAge() const;
void setDateOfBirth(int month, int day, int year);
dateType getDateOfBirth() const;
void setAttendingPhysician(string physician);
string getAttendingPhysician() const;
void setAdmitDate(int month, int day, int year);
dateType getAdmitDate() const;
void setDischargeDate(int month, int day, int year);
dateType getDischargeDate() const;
void setBillInfo(double phCharges =0, double rRent =0, double docFee =0);
void printPatientInfo() const;
double billingAmount() const;
patientType(string id ="", int age =0, dateType dob = dateType(),
string physician ="", dateType admitDate = dateType(), dateType dischargeDate = dateType(),
double phCharges =0, double rRent =0, double docFee =0);
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago