Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me on C++ Using codeblocks 1. Design the class doctorType, inherited

ID: 645242 • Letter: P

Question

Please help me on C++ Using codeblocks

1. Design the class doctorType, inherited from the class personType, defined in the book
(Chapter 11 or 12), with an additional data member to store a doctor

1. Design the class doctorType, inherited from the class personType, defined in the book (Chapter 11 or 12), 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. 2. 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 and access and manipulate the data members. 3. Design the class patientType, inherited from the class personType, defined in the book (Chapter 11 or 12), 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.

Explanation / Answer

#include
#include
using namespace std;


class personTypeImpl
{
public:
   void print() const;
   void SetName(string first, string last);
   string getFirstName() const;
   string getLastName() const;
   personTypeImpl(string first = "", string last = "");

private:
   string FirstName, LastName;
};
void personTypeImpl :: print() const
{
   cout << FirstName << " " << LastName << endl;
}
void personTypeImpl :: SetName(string first, string last)
{
   FirstName = first;
   LastName = last;
   cout << "Please Enter Your FIRST Name. ";
   cin >> first;
   cout << "Please Enter Your LAST Name. ";
   cin >> last;
}
string personTypeImpl :: getFirstName() const
{
   return FirstName;
}
string personTypeImpl :: getLastName() const
{
   return LastName;
}
personTypeImpl :: personTypeImpl(string first, string last)
{
   FirstName = first;
   LastName = last;
}

/************************/

#include
#include
using namespace std;


class patientTypeImpl : public personTypeImpl
{

public:
   void print() const;
   void SetName(string first, string last);
   void SetPatientID(int ID);
   void SetPatientAge(int Age);
   int getPatientAge() const;
   int getPatientID() const;
   string getFirstName() const;
   string getLastName() const;
   patientTypeImpl(string first = "", string last = "");
   patientTypeImpl(int ID);
   patientTypeImpl(int Age);

private:
   string FirstName, LastName;
   int PatientID, PatientAge;
};

int patientTypeImpl::getPatientID() const
{
   return PatientID;
}
int patientTypeImpl::getPatientAge() const
{
   return PatientAge;
}
patientTypeImpl::patientTypeImpl(string first = "", string last = "")
{
   FirstName = first;
   LastName = last;
}

patientTypeImpl::patientTypeImpl(int ID)
{
   PatientID = ID;
}

patientTypeImpl::patientTypeImpl(int Age)
{
   PatientAge = Age;
}

*****************

#include
#include
using namespace std;

class doctorTypeImpl : public personTypeImpl
{
public:
   void SetName(string first, string last);
   void SetSpeciality(string Special);
   string getSpeciality() const;
   string getFirstName() const;
   string getLastName() const;
   doctorTypeImpl(string Special = "");

private:
   string FirstName, LastName, Speciality;
};
void doctorTypeImpl :: SetSpeciality(string Special)
{
   Speciality = Special;
   cout << "Please Enter Your SPECIALITY. ";
   cin >> Special;
}
string doctorTypeImpl :: getSpeciality() const
{
   return Speciality;
}
doctorTypeImpl :: doctorTypeImpl(string Special = "")
{
   Speciality = Special;
}

******************************

#include
#include
using namespace std;

class dateTypeImpl
{
public:
   void printDate() const;
   void SetDate(int Day, int Month, int Year);
   int getTheDay() const;
   int getTheMonth() const;
   int getTheYear() const;
   dateTypeImpl(int Day,int Month, int Year);
  
private:
   int TheDay, TheYear, TheMonth;
};
void dateTypeImpl :: printDate() const
{
   cout << TheDay << " " << TheMonth << " " << TheYear << endl;
}
void dateTypeImpl :: SetDate(int Day, int Month, int Year)
{
   TheDay = Day;
   TheMonth = Month;
   TheYear = Year;
  
   cout << "Please Enter The Day (DD). ";
   cin >> Day;
   cout << "Please Enter The Month (MM). ";
   cin >> Month;
   cout << "Please Enter The Year (YYYY). ";
   cin >> Year;
}
int dateTypeImpl :: getTheDay() const
{
   return TheDay;
}
int dateTypeImpl :: getTheMonth() const
{
   return TheMonth;
}
int dateTypeImpl :: getTheYear() const
{
   return TheYear;
}
dateTypeImpl::dateTypeImpl(int Day, int Month, int Year)
{
   TheDay = Day;
   TheMonth = Month;
   TheYear = Year;
}

class DateOfBirthType : public dateTypeImpl
{
public:
   void printDOB() const;
   void SetDOB(int Day, int Month, int Year);
   int getTheDay() const;
   int getTheMonth() const;
   int getTheYear() const;

private:
   int TheDay, TheYear, TheMonth;
};
void DateOfBirthType :: printDOB() const
{
   cout << "Patients Date Of Birth: " << TheDay << "/" << TheMonth << "/" << TheYear << endl;
}
void DateOfBirthType :: SetDOB(int Day, int Month, int Year)
{
   TheDay = Day;
   TheMonth = Month;
   TheYear = Year;

   cout << "Enter The Patients DAY Of Birth. ";
   cin >> Day;
   cout << "Enter The Patients MONTH Of Birth. ";
   cin >> Month;
   cout << "Enter The Patients YEAR Of Birth. ";
   cin >> Year;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote