Professional Documents
Culture Documents
S)
CERTIFICATE
This is to certify that Mr./Ms. Nikhil Rangnath Burkhunde , Roll no 97,
Yash Avinash Pondhe of Third Semester of Diploma in Computer
Engineering of Institute
(code 0066)has completed the micro project work satisfactorily in
subject Object Oriented Programming Language for the academic
year 2020-2021 as prescribe in the curriculum
Prof. S.G.Deshmukh
Principal
Marathwada Institute of Technology, Polytechnic, Aurangabad (M.S.)-431 005
Introduction:
struct patient
{
long long ID;
string firstname;
string lastname;
int age;
char blood[5];
char gender;
patient*next;
};
class linkedqueue
{
patient *head,*last;
public:
linkedqueue() //constructor
{
head=NULL;
last=NULL;
}
patient input();
void insertatend();
void insertatbeg();
void getpatientout();
void listofpatients();
int search(int);
char departmentname[50];
};
}
cout<<"\tGender : (m/f)";
cin>>p->gender;
cout<<"\tAge : ";
cin>>p->age;
cout<<"\tMobile number : ";
cin>>p->ID;//=readnumber()1353;
if(search(p->ID))
{
p->ID=0;
cout << "\n\tData not valid. Operation cancelled.";
}
return *p;
}
if(head==NULL)
{
head=p;
last=p;
p->next=NULL;
}
else
{
p->next=head;
head=p;
}
system("cls");
cout << "\n\tPatient added:";
output(p);
}
void linkedqueue:: insertatend()
{
patient*p=new patient();
*p=input();
if(p->ID==0)
return;
if(head==NULL)
{
head=p;
last=p;
p->next=NULL;
}
else
{
p->next=NULL;
last->next=p;
last=p;
}
system("cls");
cout << "\n\tPatient added:";
output(p);
}
void linkedqueue :: getpatientout()
{
system("cls");
if(head==NULL)
{
cout<<"\n\tNo Patient to operate";
}
else
{
patient*p=new patient();
p=head;
head=head->next;
cout << "\n\tPatient to operate:";
output(p);
}
}
switch (choice)
{
case 1: q->insertatend();
cout << "\n\tPress any key";
getch();
break;
case 2: q->insertatbeg();
cout << "\n\tPress any key";
getch();
break;
case 3: q->getpatientout();
cout<<"\n\tPress any key";
getch();
break;
case 4: system("cls");
q->listofpatients();
cout<<"\n\tPress any key";
getch();
break;
}
}
}
int main ()
{
int i, choice = 0;
linkedqueue departments[4];
system("COLOR 5F");
while(choice!=5)
{
strcpy(departments[0].departmentname,"General Clinic\n");
strcpy(departments[1].departmentname,"Heart Clinic\n");
strcpy(departments[2].departmentname,"Lung Clinic\n");
strcpy(departments[3].departmentname,"Plastic Surgery\n");
system("cls");
cout<<"\n\t>>>>>>>>>>>>>>>>>>>>>>>>>>";
cout<<"\n\tHOSPITAL MANAGEMENT SYSTEM\t";
cout<<"\n\t<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n";
for (i = 0; i < 4; i++)
{
cout<<"\t"<<(i+1)<<": "<<departments[i].departmentname;
}
cout<<"\t5: Exit";
cout<<"\n\n\tPlease enter your choice : ";
choice=readnumber();
if(choice>=1 && choice<=4)
{
departmentmenu(&departments[choice-1]);
}
}
if(choice==5)
exit(0); //system end cp
}
Output :
1]
2]
3]
4]