In: Computer Science
I need new and unique answers, please. (Use your own words, don't copy and paste), Please Use your keyboard (Don't use handwriting) Thank you..
Question 3: [ 7.5 marks]
A doctor’s clinic has a system to announce the next patient to enter the examination room. The patients waiting room management system has four display screens
When the receptionist scans the patient’s file bar code, the patient’s file number appears in all screens so the patient knows his turn. The doctor will also be able to verify the next patient’s file number. When new file umber is entered, all screens should change to display the next patient’s file number.
The class diagram is used for the systematic analysis of
conceptual modeling of the application
which helps to show the classes of the system, their
interrelations, and the operation and
attributes of the classes.The following attached diagram which is used for the
systematic analysis of conceptual
modeling of the application which helps to show the classes of the
system, their interrelations,
and the operation and attributes of the classes. Analysis of
classes is identified by examining the
problem statement the classes such as receptionist, Patient and
Doctor.
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
// define maximum number of patients in a queue
#define MAXPATIENTS 50
// define patient data
struct patient
{
char First_name[30];
char Last_name[30];
barcode [30]
};
// define class for queue
class queue
{
public:
queue (void);
int AddPatientAtEnd (patient p);
int AddPatientAtBeginning (patient p);
patient GetNextPatient (void);
int RemoveDeadPatient (patient * p);
void OutputList (void);
};
// declare member functions for queue
queue::queue ()
{
// constructor
NumberOfPatients = 0;
}
int queue::AddPatientAtEnd (patient p)
{
// adds a normal patient to the end of the queue.
// returns 1 if successful, 0 if queue is full.
if (NumberOfPatients >= MAXPATIENTS)
{
// queue is full
return 0;
}
// put in new patient
else
List[NumberOfPatients] = p; NumberOfPatients++;
return 1;
}
int queue::AddPatientAtBeginning (patient p)
{
// adds a critically ill patient to the beginning of the
queue.
// returns 1 if successful, 0 if queue is full.
int i;
if (NumberOfPatients >= MAXPATIENTS)
{
// queue is full
return 0;
}
// move all patients one position back in queue
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)
{
// gets the patient that is first in the queue.
// returns patient with no ID if queue is empty
int i; patient p;
if (NumberOfPatients == 0) {
// queue is empty
strcpy(p.ID,"");
return p;}
// get first patient
p = List[0];
// move all remaining patients one position forward in queue
NumberOfPatients--;
for (i=0; i<NumberOfPatients; i++)
{
List[i] = List[i+1];
}
// return patient
return p;
}
{
List[j] = List[j+1];
}
}
}
return found;
}
void queue::OutputList (void)
{
// display number on screen
int i;
if (NumberOfPatients == 123)
{
cout << "123 patient will be
next">>
";
}
else
{
for (i=0; i<NumberOfPatients;
i++)
{
cout <<
"
" << List[i].FirstName;
cout << " "
<< List[i].LastName;
cout << " "
<< List[i].ID;
}
}
}
// declare functions used by main:
patient InputPatient (void)
{
// this function asks user for patient data.
patient p;
cout << "
Please scan next barcode: ";
cin.getline(p.First_nameof(p.FirstName));
return p;
}
void OutputPatient (patient * p)
{
// this function outputs patient data to the screen
if (p == NULL || p->ID[0]==0)
{
cout << "
No patient";
return;
}
else
cout << "
Patient data:";
cout << "
First name: " << p->FirstName;
cout << "
Last name: " << p->LastName;
cout << "
Social security number: " << p->ID;
}
int ReadNumber()
{
// this function reads an integer number from the keyboard.
// it is used because input with cin >> doesn't work
properly!
char buffer[20];
cin.getline(buffer, sizeof(buffer));
return atoi(buffer);
}
void DepartmentMenu (queue * q)
{
// this function defines the user interface with menu for one
department
int choice = 0, success; patient p;
while (choice != 6)
{
// clear screen
clrscr();
// print menu
cout << "
}
else
{
// error
cout << "
}
OutputPatient(&p);
cout <<
"
Press any key";
getch();
}
";
OutputPatient(&p);}
else
{
cout << "
There is no patient to operate.";
}
cout << "
Press any key";
getch();
}
}
Do you think your deign will present the best architectural style (Static), How
Yes because it is in simple language and easy to understand.