?? hospital sys01.cpp
字號:
{
cout<<"\n\n\n\t\t\tRecord does not exist";
box();
}
};
//////////////creates a box on the screen/////////////
void box()
{
int i,j;
for(i=0;i<50;i++)
{
gotoxy(15+i,3);
putch(char(205));
gotoxy(15+i,16);
putch(char(205));
}
for(j=0;j<13;j++)
{
gotoxy(15,3+j);
putch(char(186));
gotoxy(65,3+j);
putch(char(186));
}
gotoxy(15,3); putch(char(201));
gotoxy(15+i,3); putch(char(187));
gotoxy(15,16); putch(char(200));
gotoxy(15+i,16);putch(char(189));
};
////////////overloading previous function to increase size of box///////////
void box(int e)
{
int i,j;
for(i=0;i<50+e;i++)
{
gotoxy(15+i,3);
putch(char(205));
gotoxy(15+i,15);
putch(char(205));
}
for(j=0;j<12;j++)
{
gotoxy(15,3+j);
putch(char(186));
gotoxy(65+e,3+j);
putch(char(186));
}
gotoxy(15,3); putch(char(201));
gotoxy(15+i,3); putch(char(187));
gotoxy(15,15); putch(char(200));
gotoxy(15+i,15);putch(char(189));
};
////////////displays a menu for choosing fields while inputting a new record////////
void dismenu(int i)
{
gotoxy(24,25);
if(i==1)
{
cout<<"We treat:1.cancer"
<<"\n\t\t\t\t2.radioactive exposure"
<<"\n\t\t\t\t3.bullet wound"
<<"\n\t\t\t\t4.ocd"
<<"\n\t\t\t\t5.split personality"
<<"\n\t\t\t\t6.pregnanacy";
}
else if(i==2)
{
cout<<"VALID CONDITIONS "
<<"\n\t\t\t\t1.stage 1 "
<<"\n\t\t\t\t2.stage 2 "
<<"\n\t\t\t\t3.operable "
<<"\n\t\t\t\t4.critical "
<<"\n\t\t\t\t5.terminal "
<<"\n\t\t\t\t6.dead "
<<"\n\t\t\t\t7.discharged";
}
else if(i==3)
{
cout<<"WARDS AVAILABLE "
<<"\n\t\t\t\t1.general "
<<"\n\t\t\t\t2.private "
<<"\n\t\t\t\t3.quarantine"
<<"\n\t\t\t\t4.maternity "
<<"\n\t\t\t\t5.emergency"
<<"\n\t\t\t\t6.recovery ";
}
else if(i==4)
{
cout<<" "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t "
<<"\n\t\t\t\t ";
}
};
////////////sets disease/condition/ward from given option////////////
int patient::diset(int d,int i)
{
if(i==1)
{
if(d==1)
strcpy(disease,"cancer");
else if(d==2)
strcpy(disease,"radioactive exposure");
else if(d==3)
strcpy(disease,"bullet wound");
else if(d==4)
strcpy(disease,"ocd");
else if(d==5)
strcpy(disease,"split personality");
else if(d==6)
strcpy(disease,"pregnanacy");
else
return(1);
}
else if(i==2)
{
if(d==1)
strcpy(cond,"stage 1");
else if(d==2)
strcpy(cond,"stage 2");
else if(d==3)
strcpy(cond,"operable");
else if(d==4)
strcpy(cond,"critical");
else if(d==5)
strcpy(cond,"terminal");
else if(d==6)
strcpy(cond,"dead");
else
return(1);
}
if(i==3)
{
if(d==1)
strcpy(ward,"general");
if(d==2)
strcpy(ward,"private");
if(d==3)
strcpy(ward,"quarantine");
if(d==4)
strcpy(ward,"maternity");
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -