Question

In: Computer Science

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

urgent!!! code in c++

- cannot use vector

- please use inheritance

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

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

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

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

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

    • 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 library string.

    • 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 data members:
    • 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 the appointments of that doctor. The appointment durations are 30 mins and they always begin on the hour or half hour. Doctors see patients Monday to Friday during 9.00-12.00 and 14.00-17.00. This array is initialized to empty strings to indicate that at the beginning all the appointments are available. When an appointment is given a pointer to the medical insurance of the patient is stored at that location.

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

    • Doctor’s name.

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

f) Define a class ClinicManager with the following data members:

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 patient appointments given by the clinic in a week.

At least the following member functions should be provided,

A member function that receives a patient object and inserts it to the Patient pointer array. It will check if the patient is already in the array to prevent multiple copies of the patient object in the array.
A member function that receives a doctor object and inserts to the Doctor pointer array.
A member function that processes appointment requests. The function will receive an AppointmentRequest object, then will check the requested doctor’s schedule to determine if the appointment can be made. If the appointment can be scheduled it will store the medical insurance of the patient in the appointment array of that doctor. It will create an AppointmentTime object from part b). Then, it will find the patient in the Patient pointer array and store the doctor’s name and AppointmentTime object in the patient object in the Patient pointer array. Finally, the member function will return the AppointmentTime object. If the doctor is already fully booked on that day this object should should return zeros for the appointment time.
A member function that cancels an appointment, receives doctor’s name and medical insurance of the patient. Then it removes the appointment both from the doctor’s schedule and from the patient.
A member function that receives a doctor’s name as a parameter and prints name and medical insurance number of all the patients that have booked an appointment with that doctor.

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

  • - Creates a ClinicManager object

  • - Creates doctor objects and calls to the doctor insert member function.

  • - Creates Patient and AppointmentRequest objects and calls to the member functions that

    processes the appointments, then outputs the time of the appointment.

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

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

      seen in the class.

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

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

Solutions

Expert Solution

#include<iostream>
#include<string>
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();
};


Related Solutions

urgent!!! code in c++ - cannot use vector - please use inheritance -please identify the .h...
urgent!!! code in c++ - cannot use vector - please use inheritance -please identify the .h and .cpp files and add tester program and screenshot of output! -please complete all parts I will upvote thank you!!! Define the following classes to manage the booking of patients in a medical clinic. a) Define a class Date that has the following integer data members: month, day and year. b) Define a class AppointmentTime that has the following data members: day (string), hour...
Please use c++ Consider the code on the next page. It creates a vector of five...
Please use c++ Consider the code on the next page. It creates a vector of five strings of vegetable names and you want to make the vector contain only vegetable names that you like. In the spaces designated, perform the following: Declare an iterator for a vector of strings, move it to the position of 'Tomato', and erase it because it's not a vegetable. With the same iterator, use .begin() to point it to the beginning of the list, and...
please write the code in C not c++, and not to use Atoi or parseint to...
please write the code in C not c++, and not to use Atoi or parseint to parse the string, Thank you. #include <stdio.h> #include <stdbool.h> /* * The isinteger() function examines the string given as its first * argument, and returns true if and only if the string represents a * well-formed integer. A well-formed integer consists only of an * optional leading - followed by one or more decimal digits. * Returns true if the given string represents an...
Fill in the blanks with suitable code and identify the type of inheritance in the following...
Fill in the blanks with suitable code and identify the type of inheritance in the following code snippet.(CO5) [Write all the three constructors completely in the answer sheet. Don’t write any other parts of the program] class Xyz { int one, two; public: Xyz(--------) {one=i; --------; } }; class Abc { int dc; public: Abc(int k) {-----------;} }; class Ijk: public Abc, public Xyz { int f; public: Ijk(int l, int m, int z, int n):-------,--------- { f=n;} }; int...
C++ please test 1 > run Enter 1st vector (2 floats): 0 0 Coordinates cannot both...
C++ please test 1 > run Enter 1st vector (2 floats): 0 0 Coordinates cannot both be zero. Enter 1st vector (2 floats): 0 0 Coordinates cannot both be zero. Enter 1st vector (2 floats): 1 0 Enter 2nd vector (2 floats): 0 0 Coordinates cannot both be zero. Enter 2nd vector (2 floats): 0 0 Coordinates cannot both be zero. Enter 2nd vector (2 floats): 1 0 First vector: (1, 0) has length 1 Second vector: (1, 0) has...
Please use C language to code all of the problems below. Please submit a .c file...
Please use C language to code all of the problems below. Please submit a .c file for each of the solutions, that includes the required functions, tests you wrote to check your code and a main function to run the code. Q2. Implement the quick-sort algorithm.
Code in C++ Objectives Use STL vector to create a wrapper class. Create Class: Planet Planet...
Code in C++ Objectives Use STL vector to create a wrapper class. Create Class: Planet Planet will be a simple class consisting of three fields: name: string representing the name of a planet, such as “Mars” madeOf: string representing the main element of the planet alienPopulation: int representing if the number of aliens living on the planet Your Planet class should have the following methods: Planet(name, madeOf, alienPopulation) // Constructor getName(): string // Returns a planet’s name getMadeOf(): String //...
Also please add comments on the code and complete in C and also please use your...
Also please add comments on the code and complete in C and also please use your last name as key. The primary objective of this project is to increase your understanding of the fundamental implementation of Vigenere Cipher based program to encrypt any given message based on the Vignere algorithm. Your last name must be used as the cipher key. You also have to skip the space between the words, while replicating the key to cover the entire message. Test...
Code in C# please. Write a program that will use the greedy algorithm. This program will...
Code in C# please. Write a program that will use the greedy algorithm. This program will ask a user to enter the cost of an item. This program will ask the user to enter the amount the user is paying. This program will return the change after subtracting the item cost by the amount paid. Using the greedy algorithm, the code should check for the type of bill. Example: Cost of item is $15.50 User pays a $20 bill $20...
Use R code Create a vector V with 8 elements (7,2,1,0,3,-1,-3,4): Transform that vector into a...
Use R code Create a vector V with 8 elements (7,2,1,0,3,-1,-3,4): Transform that vector into a rectangular matrix A of dimensions 4X2 (4- rows, 2-columns); Create a matrix transpose to the above matrix A. Call that matrix AT; Calculate matrix products: A*AT and AT*A. Present the results. What are the dimensions of those two product matrices; Square matrixes sometimes have an inverse matrix. Try calculating inverse matrices (or matrixes, if you prefer) of above matrices (matrixes) A*AT and AT*A; Extend...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT