urgent!!! code in c++ - cannot use vector - please use inheritance -please identify the .h and .cpp...

Free

90.2K

Verified Solution

Question

Programming

urgent!!! code in c++

- cannot use vector

- please use inheritance

-please identify the .h and .cpp files and add tester programand screenshot of output!

-please complete all parts I will upvote thank you!!!

  1. Define the following classes to manage the booking of patientsin a medical clinic.

    a) Define a class Date that has the following integer datamembers: month, day and year.
    b) Define a class AppointmentTime that has the following datamembers: day (string), hour (int) and minute (int).

  2. c) Define a class Patient with the following datamembers:

    • The name of the patient as a standard library string.

    • The date of birth of the patient (from part a).

    • Medical insurance number of the patient as a standard librarystring.

    • Name of the doctor for the appointment.

    • Day and time of the appointment (from part b).

      A patient may have a single doctor’s appointment each week.

    • d) Define a class Doctor with the following datamembers:
    • The name of the doctor as a standard library string.

    • The date of birth of the doctor (from part a).

    • A two-dimensional string pointer array of 12-by-5 that shows theappointments of that doctor. The appointment durations are 30 minsand they always begin on the hour or half hour. Doctors seepatients Monday to Friday during 9.00-12.00 and 14.00-17.00. Thisarray is initialized to empty strings to indicate that at thebeginning all the appointments are available. When an appointmentis given a pointer to the medical insurance of the patient isstored at that location.

    • e) Define an AppointmentRequest class with thefollowing data members:
    • A Patient object from part (b).

    • Doctor’s name.

    • The day that appointment is requested as a standard librarystring (Monday to Friday).

f) Define a class ClinicManager with the following datamembers:

An array of pointers to the Patient objects of size 200.
An array of pointers to the Doctor objects of size 20.
An integer variable that counts total number of patientappointments given by the clinic in a week.

At least the following member functions should beprovided,

A member function that receives a patient object and inserts itto the Patient pointer array. It will check if the patient isalready in the array to prevent multiple copies of the patientobject in the array.
A member function that receives a doctor object and inserts to theDoctor pointer array.
A member function that processes appointment requests. The functionwill receive an AppointmentRequest object, then will check therequested doctor’s schedule to determine if the appointment can bemade. If the appointment can be scheduled it will store the medicalinsurance of the patient in the appointment array of that doctor.It will create an AppointmentTime object from part b). Then, itwill find the patient in the Patient pointer array and store thedoctor’s name and AppointmentTime object in the patient object inthe Patient pointer array. Finally, the member function will returnthe AppointmentTime object. If the doctor is already fully bookedon that day this object should should return zeros for theappointment time.
A member function that cancels an appointment, receives doctor’sname and medical insurance of the patient. Then it removes theappointment both from the doctor’s schedule and from thepatient.
A member function that receives a doctor’s name as a parameter andprints name and medical insurance number of all the patients thathave booked an appointment with that doctor.

g) Write a driver program that demonstrate thefunctionality of your program including:

  • - Creates a ClinicManager object

  • - Creates doctor objects and calls to the doctor insert memberfunction.

  • - Creates Patient and AppointmentRequest objects and calls tothe member functions that

    processes the appointments, then outputs the time of theappointment.

  • Key Considerations for the assignment:
    • § You must enforce encapsulation by keeping all data membersprivate.

    • § You need to make sure that your classes are well defined usingthe various concepts

      seen in the class.

    • § Provide needed set/get functions for the data members.

    • § Objects should be created dynamically and must be deleted whenno longer needed. There should be an output statement confirmingthe deletion of an object from the destructor function.

Answer & Explanation Solved by verified expert
3.6 Ratings (339 Votes)

#include
#include
using namespace std;
class Date{
   public:
       int month, day, year;
  
};
class AppointmentTime{
   public:
       string day;
       int hour;
       int minute;
};

class Patient{
   public:
       string name;
      
       string insuranceNo;
       string nameOfDoctor;
       Date dob;
       AppointmentTime appointmentTime;
};

class Doctor{
   public:
       string nameOfDoctor;
       Date dobOfDoctor;
       string *app[12][5];

      
};

class AppointmentRequest{
   public:
       Patient patient;
       string doctorName;
       string day;
};

class ClinicManager{
   public:
       int *patient[200];
       int *doctor[20];
       int appointmentsgivenbyclinic;
       bool addPatient();
};


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students