Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Data Structure Course: Write a c++ program that use the table below of compatibi

ID: 3874384 • Letter: D

Question

Data Structure Course: Write a c++ program that use the table below of compatibility blood tranfusion. The program should ask how many patients you are going to insert in form of a array and store there information of blood type. The program should ask the patient he is a recipient or the donor and then ask for his blood type. The program should print combination if the result of the blood transfusion matches or is not compatible between patients. Which patient is doing the transfusion to the other patient and show there blood types.

RED BLOOD CELL COMPATIBILITY TABLE Donor O- O+ A A+ B- B+ AB- AB+

Explanation / Answer

#include<iostream.h>
#include<dos.h>
#include<graphics.h>
#include<conio.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#include<process.h>
class DONOR
{
int age1;
char occupation1[30],place1[30];
int weight1;
int pulse1;
char bp1[10];
public:
int rno,donval;
char name1[30],blood1[5];
void getit(int);
void putit();
};
class GROUPS
{
public:
int op,on,ap,an,bp,bn,ab;
void getit();
};
class ACCEPTOR
{
public:
int recval,rno;
char name2[30],blood2[5],hosp[20];
void getit();
};
int doncrit()
{
int ret=0;
char ch[5];
mn:
clrscr();
for(int i=0;i<=79;i++)
{
cout<<"!";
}
delay(100);
textcolor(BLINK + MAGENTA);
cout<<" ----- HEALTH CRITERIA FOR BLOOD DONATION -----";
delay(1000);
textcolor(BLUE);
cout<<" Conditions for donation of blood ";
delay(1000);
cout<<" (1)General : No person shall donate blood more than once in three months";
cout<<" The donor shall be in good health, mentally alert and physically fit and shall not be inmates of jail ";
cout<<"persons having multiple sex partners and drug-addicts";
cout<<"The donors should fulfill the following requirements, namely :- ";
cout<<" (a)The donor should be in the age group of 18 to 60 years ";
cout<<" (b)The donor should not be less than 45 kilograms ";
cout<<" (c)Temperature and Pulse of the donor should be normal ";
cout<<" (d)The systolic and diastolic blood pressures are within normal limits without medication";
cout<<" (e)Haemoglobin of the donor should not be less than 12.5 grams";
cout<<" (f)The donor should be free from acute respiratory diseases";
cout<<" (g)The donor should be free from any skin diseases at the site of phlebotomy ";
cout<<" (h)The donor should be free from any disease transmissible by blood transfusion, insofar as can be determined by history and examination indicated above ";
cout<<" (i)The arms and forearms of the donor should be free from skin punctures and scars indicative of professional blood donors ";
cout<<" (j)The donor should be free from addiction to self injected narcotics ";
m:
cout<<" Is the donor violating any of the above mentioned conditions?(yes or no) ";
gets(ch);
{
if(strcmpi(ch,"no")==0)
{
cout<<" Processing";
for(int i=0;i<6;i++)
{
delay(200);
cout<<".";
}
}
else if(strcmpi(ch,"yes")==0)
{
cout<<" Sorry you are not eligible for blood donation ";
cout<<" Returning to main menu";
for(int i=0;i<6;i++)
{
delay(200);
cout<<".";
}
clrscr();
ret=1;
goto pq;
}
else
{
cout<<" Invalid entry ";
cout<<" Please enter again ";
goto m;
}
}
delay(2000);
textcolor(YELLOW);
delay(1000);
cout<<" (2)The blood bank shall not accept blood from a person suffering from any of the under mentioned disease : ";
cout<<" a. Cancer b. Heart disease c. Abnormal bleeding tendencies";
cout<<" d. Unexplained weight loss e. Diabetes-controlled on Insulin";
cout<<" f. Hepatitis infection g. Chronic nephritis";
cout<<" h. Signs and symptoms, suggestive of AIDS i. Liver disease";
cout<<" j. Tuberculosis k. Polycythemia Vera l. Asthma ";
cout<<" m. Epilepsy n. Leprosy o. Schizophrenia p. Endocrine disorders";
mm:
cout<<" Is the donor affected by any of the above mentioned diseases? (yes or no) ";
gets(ch);
{
if(strcmpi(ch,"no")==0)
{
cout<<" Processing";
for(int i=0;i<6;i++)
{
delay(200);
cout<<".";
}
}
else if(strcmpi(ch,"yes")==0)
{
cout<<" Sorry you are not eligible for blood donation ";
cout<<" Returning to main menu";
for(int i=0;i<6;i++)
{
delay(200);
cout<<".";
}
clrscr();
ret=1;
goto pq;
}
else
{
cout<<" Invalid entry ";
cout<<" Please enter again ";
goto mm;
}
}
clrscr();
pq:
return ret;
}
void DONOR::getit(int rno)
{
donval=0;
cout<<" ****Enter the details****";
cout<<" Reg.No "<<rno;
cout<<" Name ";
gets(name1);
cout<<" Nationality ";
gets(place1);
lq:
cout<<" Age (18-60)";
cin>>age1;
if(age1<=18||age1>=60)
{
cout<<" Invalid Entry ";
cout<<" Please enter again";
clrscr();
goto lq;
}

int ch;
lc:
int n;
cout<<" ---------BLOOD GROUP----------";
cout<<" 1.O+ 2.O- 3.A+ 4.A- 5.B+ 6.B- 7.AB";
cout<<" --Enter the STATUS(1-2-3-4-5-6-7)-- ";
cin>>ch;
switch(ch)
{
case 1:strcpy(blood1,"O+");
break;
case 2:strcpy(blood1,"O-");
break;
case 3:strcpy(blood1,"A+");
break;
case 4:strcpy(blood1,"A-");
break;
case 5:strcpy(blood1,"B+");
break;
case 6:strcpy(blood1,"B-");
break;
case 7:strcpy(blood1,"AB");
break;
default:{
cout<<" Invalid Option ";
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto lc;
}
}
cout<<" Occupation ";
gets(occupation1);
ld:
cout<<" Weight(in kgs) (Not less than 45kgs) ";
cin>>weight1;
if(weight1<45)
{
cout<<" Invalid Entry ";
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto ld;
}
le:
cout<<" Pulse (50-90)";
cin>>pulse1;
if(pulse1<50||pulse1>90)
{
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto le;
}
lf:
cout<<" Blood Pressure Status(Normal or Abnormal) ";
gets(bp1);
if(strcmp(bp1,"Abnormal")==0)
{
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto lf;
}
}
void GROUPS::getit()
{
op=500,on=500,bp=500,bn=500,ap=500,an=500,ab=500;
}
void ACCEPTOR::getit()
{
int ch4;
cout<<" Enter the name of the acceptor : ";
gets(name2);
cout<<" From which hospital is the acceptor referred to us : ";
gets(hosp);
cout<<" Enter the bloodgroup of the acceptor : ";
lc:
cout<<" ---------BLOOD GROUP----------";
cout<<" 1.O+ 2.O- 3.A+ 4.A- 5.B+ 6.B- 7.AB";
cout<<" --(1-2-3-4-5-6-7)-- ";
cin>>ch4;
switch(ch4)
{
case 1:strcpy(blood2,"O+");
break;
case 2:strcpy(blood2,"O-");
break;
case 3:strcpy(blood2,"A+");
break;
case 4:strcpy(blood2,"A-");
break;
case 5:strcpy(blood2,"B+");
break;
case 6:strcpy(blood2,"B-");
break;
case 7:strcpy(blood2,"AB");
break;
default:{
cout<<" Invalid Option ";
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto lc;
}
}
cout<<" How much blood do you want???";
cin>>recval;
}
Jan 26, 2013 at 9:08pm
nikhil m (5)
void DONOR::putit()
{
cout<<" ---- File Display ---- ";
cout<<"Registration Number ";
cout<<rno;
cout<<" Name : ";
puts(name1);
cout<<" Nationality : ";
puts(place1);
cout<<" Age : ";
cout<<age1;
cout<<" Blood Group : ";
puts(blood1);
cout<<" Occupation : ";
puts(occupation1);
cout<<" Weight(in kgs) : ";
cout<<weight1;
cout<<" Pulse : ";
cout<<pulse1;
cout<<" Blood Pressure Status : ";
puts(bp1);
cout<<" Donation made ";
cout<<donval;
cout<<" ";
for(int i=0;i<=79;i++)
{
delay(10);
cout<<".";
}
getch();
}
void insaccpt()
{
ACCEPTOR i;
fstream accptfile;
accptfile.open("ACCEPTOR.dat",ios::out|ios::binary|ios::app);
i.getit();
accptfile.write((char*)&i,sizeof(i));
}
void insbldgrp()
{
fstream pfile;
pfile.open("BLOODGROUPS.dat",ios::binary|ios::app);
GROUPS p;
p.getit();
pfile.write((char*)&p,sizeof(p));
}
void Insertfile()
{
fstream pfile;
int i,n,pos;
DONOR p;
pfile.open("BLOODDONATION.dat",ios::binary|ios::out|ios::app);
cout<<" How many donors to be added? ";
cin>>n;
for(i=1;i<=n;i++)
{
pos=pfile.tellg();
p.rno=(pos/sizeof(p))+1;
p.getit(p.rno);
pfile.write((char*)&p,sizeof(p));
}
pfile.close();
}
void shfn()
{
cout<<" Returning to --- DONOR MENU --- ";
for(int i=0;i<6;i++)
{
delay(100);
cout<<".";
}
}
void filedisplay()
{
ifstream pfile;
DONOR p;
pfile.open("BLOODDONATION.dat",ios::binary|ios::app);
while(pfile.read((char*)&p,sizeof(p)))
{
p.putit();
getch();
}
pfile.close();
}
void srchnm1()
{
ifstream pfile;
DONOR p;
char name[30];
pfile.open("BLOODDONATION.dat",ios::binary);
pfile.seekg(0);
cout<<" Enter the name to be searched : ";
gets(name);
while(pfile.read((char *)&p,sizeof(p)))
{
if(strcmpi(p.name1,name)==0)
{
cout<<" Displaying the record(s) found : ";
p.putit();
}
pfile.close();
}
}
void srchbg1()
{
ifstream pfile;
DONOR p;
int ch;
char blood1[5];
pfile.open("BLOODDONATION.dat",ios::binary);
pfile.seekg(0);
cout<<" Enter the bloodgroup to be searched : ";
lc:
cout<<" ---------BLOOD GROUP----------";
cout<<" 1.O+ 2.O- 3.A+ 4.A- 5.B+ 6.B- 7.AB";
cout<<" --Enter the STATUS(1-2-3-4-5-6-7)-- ";
cin>>ch;
switch(ch)
{
case 1:strcpy(blood1,"O+");
break;
case 2:strcpy(blood1,"O-");
break;
case 3:strcpy(blood1,"A+");
break;
case 4:strcpy(blood1,"A-");
break;
case 5:strcpy(blood1,"B+");
break;
case 6:strcpy(blood1,"B-");
break;
case 7:strcpy(blood1,"AB");
break;
default:{
cout<<" Invalid Option ";
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto lc;
}
}

while(pfile.read((char *)&p,sizeof(p)))
{
if(strcmp(p.blood1,blood1)==0)
{
cout<<" Displaying the record(s) found : ";
p.putit();
}
pfile.close();
}
}
void searchfile()
{
clrscr();
int ch;
do
{
cout<<" ---- Search File ----";
cout<<" 1.Search by Name ";
cout<<" 2.Search by Blood Group ";
cout<<" 3.Return to -- DONOR Menu -- ";
cin>>ch;
switch(ch)
{
case 1:srchnm1();
clrscr();
break;
case 2:srchbg1();
clrscr();
break;
case 3:break;
}
}while(ch==1 || ch==2);
}
void deletefile()
{
ifstream pfile;
ofstream tempfile;
DONOR s;
char ch[30];
pfile.open("BLOODDONATION.dat",ios::binary);
tempfile.open("Nashtemp.dat",ios::binary);
cout<<" Enter the Name of the donor whose details are to be deleted : ";
gets(ch);
while(pfile.read((char*)&s,sizeof(s)))
{
if(strcmpi(ch,s.name1)!=0)
{
tempfile.write((char*)&s,sizeof(s));
}
}
pfile.close();
tempfile.close();
remove("BLOODDONATION.dat");
rename("Nashtemp.dat","BLOODDONATION.dat");
}
void modfile()
{
ifstream pfile;
ofstream tempfile;
DONOR s;
char ch[30];
int no;
pfile.open("BLOODDONATION.dat",ios::binary);
tempfile.open("Nashtemp.dat",ios::binary);
cout<<" Enter the registration number of the donor whose details : ";
cin>>no;
while(pfile.read((char*)&s,sizeof(s)))
{
if(s.rno<no)
{
tempfile.write((char*)&s,sizeof(s));
}
else
{
break;
}
}
cout<<" Enter the new details of the record to be inserted ";
s.getit(s.rno);
tempfile.write((char*)&s,sizeof(s));
pfile.seekg(0,ios::beg);
while(pfile.read((char*)&s,sizeof(s)))
{
if(s.rno>no)
{
tempfile.write((char*)&s,sizeof(s));
}
}
pfile.close();
tempfile.close();
remove("BLOODDONATION.dat");
rename("Nashtemp.dat","BLOODDONATION.dat");
}
void makdon()
{
fstream pfile;
ofstream mfile;
DONOR p;
GROUPS q;
int don;
char name[30];
pfile.open("BLOODDONATION.dat",ios::binary|ios::in|ios::out);
mfile.open("BLOODGROUPS.dat",ios::app);
cout<<" Enter the name to be searched : ";
gets(name);
while(pfile.read((char *)&p,sizeof(p)))
{
if(strcmpi(p.name1,name)==0)
{
p:
cout<<" How much would you like to donate?? (10-100)cc ";
cin>>don;
if(don<10)
{
cout<<" Sorry, Donation cannot be less than 10 cc.";
cout<<" Please enter again ";
getch();
clrscr();
goto p;
}
else if(don>100)
{
cout<<" Sorry, Donation cannot be more than 100 cc.";
cout<<" We appreciate your helping mentality ";
cout<<" Please enter again ";
getch();
clrscr();
goto p;
}
if(strcmp(p.blood1,"O+")==0)
{
q.op+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"O-")==0)
{
q.on+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"A+")==0)
{
q.ap+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"A-")==0)
{
q.an+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"B+")==0)
{
q.bp+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"B-")==0)
{
q.bn+=don;
mfile.write((char *)&q,sizeof(q));
}
if(strcmp(p.blood1,"AB")==0)
{
q.ab+=don;
mfile.write((char *)&q,sizeof(q));
}
}
p.donval+=don;
pfile.write((char*)&p,sizeof(p));
}
pfile.close();
mfile.close();
}

void avbld()
{
clrscr();
ifstream mfile;
mfile.open("BLOODGROUPS.dat");
GROUPS m;
mfile.read((char *)&m,sizeof(m));
cout<<" ----- Available blood -----";
delay(100);
cout<<" Bloodgroup "<<" "<<"Amount(in cc)";
delay(50);
cout<<" 1. O+ "<<" "<<m.op;
cout<<" 2. O- "<<" "<<m.on;
cout<<" 3. A+ "<<" "<<m.ap;
cout<<" 4. A- "<<" "<<m.an;
cout<<" 5. B+ "<<" "<<m.bp;
cout<<" 6. B- "<<" "<<m.bn;
cout<<" 7. AB "<<" "<<m.ab;
getch();
mfile.close();
}
void accblddisp()
{
clrscr();
ifstream mfile;
mfile.open("BLOODGROUPS.dat");
GROUPS m;
mfile.read((char *)&m,sizeof(m));
cout<<" ------------------------- Available blood -------------------------";
delay(100);
cout<<" No. Bloodgroup "<<" "<<"Amount available(in cc)"<<" Cost ";
delay(50);
cout<<" 1. O+ "<<" "<<" "<<m.op<<" "<<" 10$ ";
cout<<" 2. O- "<<" "<<" "<<m.on<<" "<<" 20$ ";
cout<<" 3. A+ "<<" "<<" "<<m.ap<<" "<<" 30$ ";
cout<<" 4. A- "<<" "<<" "<<m.an<<" "<<" 30$ ";
cout<<" 5. B+ "<<" "<<" "<<m.bp<<" "<<" 35$ ";
cout<<" 6. B- "<<" "<<" "<<m.bn<<" "<<" 30$ ";
cout<<" 7. AB "<<" "<<" "<<m.ab<<" "<<" 50$ ";
getch();
clrscr();
mfile.close();
}
int chaccpt()
{
ACCEPTOR i;
GROUPS p;
ifstream accptfile;
accptfile.open("ACCEPTOR.dat");
ifstream pfile;
pfile.open("BLOODGROUPS.dat");
accptfile.read((char*)&i,sizeof(i));
pfile.read((char*)&p,sizeof(p));
int ret;
cout<<" You want "<<i.recval<<" cc of blood ";
if(strcmp(i.blood2,"O+")==0)
{
if(i.recval>p.op)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"O-")==0)
{
if(i.recval>p.on)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"A+")==0)
{
if(i.recval>p.ap)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"A-")==0)
{
if(i.recval>p.an)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"B+")==0)
{
if(i.recval>p.bp)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"B-")==0)
{
if(i.recval>p.bn)
{
ret=0;
}
else
{
ret=1;
}
}
if(strcmp(i.blood2,"AB")==0)
{
if(i.recval>p.ab)
{
ret=0;
}
else
{
ret=1;
}
}
if(ret==0)
{
cout<<" Sorry!!! We donot have suffecient blood to meet your requirements ";
cout<<" Please contact some other blood bank ";
getch();
clrscr();
}
pfile.close();
fstream mfile;
mfile.open("BLOODGROUPS.dat",ios::binary|ios::app|ios::ate|ios::in|ios::out);
if(ret==1)
{
if(strcmp(i.blood2,"O+")==0)
{
p.op-=i.recval;
mfile<<p.op;
}
if(strcmp(i.blood2,"O-")==0)
{
p.on-=i.recval;
mfile<<p.on;
}
if(strcmp(i.blood2,"A+")==0)
{
p.ap-=i.recval;
mfile<<p.ap;
}
if(strcmp(i.blood2,"A-")==0)
{
p.an-=i.recval;
mfile<<p.an;
}
if(strcmp(i.blood2,"B+")==0)
{
p.bp-=i.recval;
mfile<<p.bp;
}
if(strcmp(i.blood2,"B-")==0)
{
p.bn-=i.recval;
mfile<<p.bn;
}
if(strcmp(i.blood2,"AB")==0)
{
p.ab-=i.recval;
mfile<<p.ab;
}
}
mfile.close();
accptfile.close();
clrscr();
return ret;
}
void prcpt()
{
clrscr();
int price;
ACCEPTOR p;
ifstream accptfile;
accptfile.open("ACCEPTOR.dat");
accptfile.read((char*)&p,sizeof(p));
cout<<" ---- RECEIPT -----";
cout<<" Name : ";
puts(p.name2);
cout<<" Blood Group : ";
puts(p.blood2);
cout<<" Hospital referred from : ";
puts(p.hosp);
cout<<" Amount of blood wanted : ";
cout<<p.recval;
if(strcmp(p.blood2,"O+")==0)
{
price=p.recval*10;
}
if(strcmp(p.blood2,"O-")==0)
{
price=p.recval*20;
}
if(strcmp(p.blood2,"A+")==0)
{
price=p.recval*30;
}
if(strcmp(p.blood2,"A-")==0)
{
price=p.recval*30;
}
if(strcmp(p.blood2,"B+")==0)
{
price=p.recval*35;
}
if(strcmp(p.blood2,"B-")==0)
{
price=p.recval*30;
}
if(strcmp(p.blood2,"AB")==0)
{
price=p.recval*50;
}
cout<<" Net Price : ";
cout<<price;
getch();
clrscr();
}
void frontpage()
{
clrscr();
for(int li=10;li<71;li++)
{
gotoxy(li,15);
delay(30);
printf("/");
}
for(li=70;li>=10;li--)
{
gotoxy(li,22);
delay(30);
printf("\");
}
for(int lp=16;lp<=21;lp++)
{
gotoxy(10,lp);
delay(100);
printf("-");
}
for(lp=21;lp>=16;lp--)
{
gotoxy(70,lp);
delay(100);
printf("-");
}
gotoxy(12,17);
textcolor(BLINK + MAGENTA);
cprintf(" Welcome To LIFELINE Blood Bank Computer System ");
gotoxy(12,20);
cprintf(" Designed and Coded By Nash Technologies (C) 2012-13");
gotoxy(31,28);
textcolor(LIGHTGREEN);
cprintf("Programmed By");
gotoxy(30,31);
textcolor(11);
cprintf(" Nikhil And Christy ");
gotoxy(44,48);
textcolor(WHITE);
cprintf("Press Any Key To ..........Continue");
getch();

clrscr();
}
void pagedes()
{
for(int i=0;i<39;i++)
{
printf("*");
}
for(int p=39;p<80;p++)
{
printf("*");
}
for(i=0;i<31;i++)
{
cout<<"<";
}
textcolor(LIGHTGREEN);
cout<<" LIFELINE BLOOD BANK ";
for(i=0;i<30;i++)
{
cout<<">";
}
for(i=0;i<39;i++)
{
printf("*");
}
for(p=39;p<80;p++)
{
printf("*");
}
}
void main()
{
clrscr();
frontpage();
insbldgrp();
char status[30];
int ch,ch2,p,ret1;
textcolor(34);
textbackground(BLUE);
lb:
cout<<" ";
for(int i=1; i<=79; i++) // This for loop prints '=' from 1st col to 79th
{ // column.
gotoxy(i,16);
cout<<"=";
gotoxy(i,1);
cout<<"=";
}
for(int j=1; j<=14; j++) // This for loop prints '|' from 1st row to 14th
{ // row.
gotoxy(1,j);
cout<<"|";
gotoxy(79,j);
cout<<"|";
}

textbackground(LIGHTRED);
textcolor(LIGHTGRAY);
gotoxy(2,3);
cout<<"<<<<<<<<<<<< ----- LIFELINE BLOOD BANK ----- >>>>>>>>>>>>";
gotoxy(2,5);
cout<<" |-------- MAIN MENU -------";
cout<<" |--------- STATUS ---------";
cout<<" |1.Donor ";
cout<<" |2.Acceptor ";
cout<<" |3.Exit ";
cout<<" |-Enter the STATUS(1-2)-- ";
cin>>ch;
switch(ch)
{
case 1:strcpy(status," Donor");
break;
case 2:strcpy(status," Acceptor");
break;
case 3:exit(0);
default:{
cout<<" Invalid Option ";
cout<<" Please enter again ";
textcolor(RED);
textbackground(BLACK);
getch();
clrscr();
goto lb;
}

}
if(strcmp(status," Donor")==0)
{
p=doncrit();
if(p==1)
{
goto lb;
}
else
{
go1:
do
{
clrscr();
pagedes();
cout<<" ---- DONOR MENU ---- ";
cout<<" 1.Register donor information ";
cout<<" 2.Search for donor information";
cout<<" 3.Modify donor details";
cout<<" 4.Delete donor details";
cout<<" 5.Display donor details";
cout<<" 6.Make donation ";
cout<<" 7.Display Blood Available";
cout<<" 8.Return to MAIN MENU ";
cout<<" 9.Exit ";
cout<<" What is your choice?(1-2-3-4-5-6-7-8-9)? ";
cin>>ch2;
switch(ch2)
{
case 1:Insertfile();
break;
case 2:searchfile();
break;
case 3:modfile();
break;
case 4:deletefile();
break;
case 5:filedisplay();
break;
case 6:makdon();
break;
case 7:avbld();
break;
case 8:clrscr();
goto lb;
case 9:exit(0);
default : {
cout<<" Invalid Entry ";
goto go1;
}
}
}while(ch2==1||ch2==5||ch2==3||ch2==4||ch2==2||ch2==6||ch2==7);

}
getch();
}
if(strcmp(status," Acceptor")==0)
{
clrscr();
int ch3,t;
do
{
clrscr();
pagedes();
cout<<" ---- ACCEPTOR MENU -----";
cout<<" 1.Blood Group Content Display and cost ";
cout<<" 2.Insert and Check for Blood Availability ";
cout<<" 3.Print Receipt ";
cout<<" 4.Return to MAIN MENU ";
cout<<" 5.Exit ";
cout<<" What is your choice???(1-2-3-4) ";
cin>>ch3;
switch(ch3)
{
case 1:accblddisp();
break;
case 2:{
insaccpt();
t=chaccpt();
if(t==0)
goto lb;
break;
}
case 3:{
prcpt();
break;
}
case 4:clrscr();
goto lb;
case 5:exit(0);
clrscr();
}
}
while(ch3==1||ch3==2||ch3==3);
}
}