Write a program that computes a patient Solution //Here’s the code bro //Enjoy #
ID: 3655527 • Letter: W
Question
Write a program that computes a patientExplanation / Answer
//Here’s the code bro //Enjoy #include #include #include #include #define MAXPATIENTS 1000 class queue { public: queue (void); int AddPatientAtEnd (patient p); int AddPatientAtBeginning (patient p); patient GetNextPatient (void); int RemoveDeadPatient (patient * p); void OutputList (void); char DepartmentName[500]; private: int NumberOfPatients; patient List[MAXPATIENTS]; }; queue::queue () { // constructor NumberOfPatients = 0; } struct patient { char FirstName[500]; char LastName[500]; char ID[100]; }; int queue::AddPatientAtEnd (patient p) { if (NumberOfPatients >= MAXPATIENTS) { return 0; } // put in new patient else List[NumberOfPatients] = p; NumberOfPatients++; return 1; } int queue::AddPatientAtBeginning (patient p) { int i; if (NumberOfPatients >= MAXPATIENTS) { // queue is full return 0; } for (i = NumberOfPatients-1; i >= 0; i--) { List[i+1] = List[i]; } // put in new patient List[0] = p; NumberOfPatients++; return 1; } patient queue::GetNextPatient (void) { int i; patient p; if (NumberOfPatients == 0) { strcpy(p.ID,""); return p;} p = List[0]; NumberOfPatients--; for (i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.