3. Meherin Amir
ID:162-15-7922
B.Sc. in CSE (3rd Semester)
Daffodil International University
Rakib Hasan
ID:162-15-7802
B.Sc. in CSE (3rd Semester)
Daffodil International University
MD.Rakibur Rahman Khan
ID:162-15-7866
B.Sc. in CSE (3rd Semester)
Daffodil International University
Group Members
Mohammod Mahmudul Hasan
ID:162-15-7760
B.Sc. in CSE (3rd Semester)
Daffodil International University
4. With respect to
Dr. Sheak Rashed Haider Noori
Associate Professor and Associate Head
Department of Computer Science and Engineering
Faculty of Science and Information Technology
Daffodil International University
23. The Main Function
int main()
{
head=(node*)malloc(sizeof(node));
head->next=NULL;
int query,query2,password;
while(1)
{
printf("n1.For Patientn2.For Doctorn3.For Exitn");
scanf("%d",&query);
if(query==1)
{
Appoint(head);
}
24. The Main Function
else if(query==2)
{
printf("nEnter the password(only digits please): ");
scanf("%d",&password);
printf("n");
if(password==1234)
{
while(1)
{
printf("1.Showlistn2.Calln3.Main Menun");
scanf("%d",&query2);
if(query2==1)
{
Showlist(head);
continue;
}
25. The Main Function
else if(query==2)
{
printf("nEnter the password(only digits please): ");
scanf("%d",&password);
printf("n");
if(password==1234)
{
while(1)
{
printf("1.Showlistn2.Calln3.Main Menun");
scanf("%d",&query2);
if(query2==1)
{
Showlist(head);
continue;
}
26. The Main Function
else if(query2==2)
{
Call();
continue;
}
else if(query2==3)
{
break;
}
}
}
else
{
printf("nWrong passwordn");
printf("Choose the correct option pleasen");
continue;
}
}
27. The Main Function
else if(query2==2)
{
Call();
continue;
}
else if(query2==3)
{
break;
}
}
}
else
{
printf("nWrong passwordn");
printf("Choose the correct option pleasen");
continue;
}
}
29. The Appoint Function (En-queue)
void Appoint(node *pointer)
{ printf("n*******Appointment Portal********n");
while(1)
{
printf("n1.For appointmentn2.For Main Menun3.For exitn");
int query;
scanf("%d",&query);
if(query==1)
{
int serial;
char name[40];
if(appointment==0)
{
printf("Appointment not avilablen");
return;
}
30. The Appoint Function (En-queue)
else if(appointment!=0)
{
while(pointer->next!=NULL)
{
pointer=pointer->next;
}
printf("Write down your name: ");
getchar();
gets(name);
strcpy(pointer->s,name);
while(1)
{
printf("Write down your phone Number: ");
gets(pointer->p);
int len=0;
len=strlen(pointer->p);
if(len!=11)
{
printf("nInvalid Phone Numbern");
printf("Try agian pleasenn");
continue;
}
31. The Appoint Function (En-queue)
int i,j=0;
for(i=0;pointer->p[i]!=NULL;i++)
{
if(pointer->p[i]<'0' || pointer->p[i]>'9')
{
printf("nInvalid Phone Numbern");
printf("nTry again pleasen");
j=1;
break;
}
}
if(j==1)
{
continue;
}
if(len==11)
{
break;
}
}
32. The Appoint Function (En-queue)
appointment--;
serial=20-appointment;
pointer->serial=serial;
printf("nAppointment acceptedn");
printf("Your serial number is %dn",serial);
pointer->next=(node*)malloc(sizeof(node));
pointer=pointer->next;
pointer->next=NULL;
continue;
}
}
else if(query==2)
{
return;
}
else if(query==3)
{
exit(0);
}
}
return;
}
33. The Showlist Function (Queue Search)
void Showlist(node *pointer)
{
if(pointer->next==NULL)
{
printf("No more patient presentn");
}
while(pointer->next!=NULL)
{
printf("Serial %d: ",pointer->serial);
printf("%sn",pointer->s);
printf(" Ph:%sn",pointer->p);
pointer=pointer->next;
}
printf("n");
}
34. The Call Function (De-queue)
void Call()
{
if(head->next!=NULL)
{
printf("nSerial No:%d %s is callednn",head->serial,head->s);
head=head->next;
return;
}
else
{
printf("nThere is no patient to callnn");
return;
}
}