1. #include<iomanip.h>
#include<conio.h>
#include<fstream.h>
#include<graphics.h>
#include<dos.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
//********CLASS->RESTAURANT***********///
class rest
{
private:
char item[40];
int cost;
int code;
long int sum;
public:
void get(void);
void put();
void read();
void show();
int search();
int price();
}t;
int rest::search()
{return code;
}
int rest::price()
{return cost;
}
//**************Fn TO ADD DATA********************//
void rest::put()
{
cout<<"nENTER ITEM NAME : "<<endl;
gets(item);
cout<<"nENTER CODE : "<<endl;
cin>>code;
cout<<"nENTER COST : "<<endl;
cin>>cost;
cout<<endl<<endl;
} //********Fn TO SEARCH DATA************
void rest::show()
{cout<<"t"<<item<<"ttt"<<code<<"tt"<<cost<<endl;
} //**************Fn TO WRITE DATA***************
void rest::get (void)
{char n;
int N;
gotoxy(6,7);
cout<<"1:CHINESE DISHES"<<endl;
gotoxy(6,9);
cout<<"2:MEXICAN DISHES"<<endl;
gotoxy(6,11);
cout<<"3:INDIAN DISHES"<<endl;
gotoxy(6,13);
cout<<"4:ITALIAN DISHES"<<endl;
char ch;
gotoxy(21,15);
cout<<"enter your choice (1-4)"<<" : ";
ch=getche();
int p=0;
switch(ch)
2. {case '1':
ofstream foutc;
foutc.open("chinese",ios::binary|ios::app) ;
cout<<"nnHow many items do you want to enter"<<"n";
cin>>N;
do
{t.put();
foutc.write((char*)&t,sizeof(t));
p++;
}
while(N!=p);
foutc.close();
clrscr();
break;
case '2':
ofstream foutm;
foutm.open("mexican",ios::binary|ios::app) ;
cout<<"nnHow many items do you want to enter"<<"n";
cin>>N;
do
{t.put();
foutm.write((char*)&t,sizeof(t));
p++;
}
while(N!=p);
foutm.close();
clrscr();
break;
case '3':
ofstream fouti;
fouti.open("indian",ios::binary|ios::app) ;
cout<<"nnHow many items do you want to enter"<<"n";
cin>>N;
do
{t.put();
fouti.write((char*)&t,sizeof(t));
p++;
}
while(N!=p);
fouti.close();
clrscr();
break;
case '4':
ofstream foutt;
foutt.open("italian",ios::binary|ios::app) ;
cout<<"nnHow many items do you want to enter"<<"n";
cin>>N;
do
{t.put();
foutt.write((char*)&t,sizeof(t));
p++;
}
while(N!=p);
foutt.close();
clrscr();
8. }
}
getch();
}
void main()
{
clrscr();
rest obj;
cust cus;
char o;
char p;
lb:
l:
clrscr();
/**********************HOMEPAGE*****************************************/
U:
gotoxy(27,4) ;
{
cprintf("HOME");
}
gotoxy(6,7);
cout<<"PRESS 1 TO PURCHASE"<<"n";
gotoxy(6,9) ;
cout<<"PRESS 2 TO SEE THE MENU"<<"n";
gotoxy(6,11);
cout<<"PRESS 3 TO EDIT"<<"n";
gotoxy(6,13);
cout<<"PRESS 4 TO SEE THE CUSTOMERS RECORD"<<"n";
gotoxy(6,15);
cout<<"PRESS 5 TO EXIT"<<"n";
gotoxy(6,17);
cout<<"ENTER YOUR CHOICE : ";
p=getche();
clrscr();
switch(p) //*******TO PURCHASE**********//
{
case '1':
clrscr();
char a;
gotoxy(20,15);
cout<<"PRESS m TO SEE THE MENUn";
a=getche();
if(a=='m')
{w: clrscr();
t.read();
clrscr();
gotoxy(10,10);
cout<<"PRESS b TO GO BACK TO MENU OR PRESS ANY KEY TO CONTINUEn";
char q;
q=getche();
if(q=='b')
goto w;
}
int se;
clrscr();
gotoxy(31,7);
cout<<"PLACE YOUR ORDER"<<"n";
gotoxy(27,10);
cout<<"PRESS 1 FOR CHINESE DISHES"<<"n";
gotoxy(27,12);
9. cout<<"PRESS 2 FOR MEXICAN DISHES"<<"n";
gotoxy(27,14);
cout<<"PRESS 3 FOR INDIAN DISHES"<<"n";
gotoxy(27,16);
cout<<"PRESS 4 FOR ITALIAN DISHES"<<"nn";
gotoxy(27,18);
cout<<"ENTER YOUR CHOICE : ";
gotoxy(48,18);
int amt;
char g;
int s[30],total=0,c=0;
se=getche();
clrscr();
if(se==9)
return;
if(se=='1')
{int co,u;
char q;
clrscr();
gotoxy(10,5);
cout<<"ARE YOU MEMBER OF OUR RESTAURANT(Y/N)n ";
cin>>q;
clrscr();
if(q=='y'||q=='Y')
{gotoxy(10,5);
cout<<"ENTER YOUR CCODE : ";
cin>>co;
ifstream fg;
fg.open("customer",ios::binary);
while(fg.read((char*)&cus,sizeof(cus)))
{
if(co==cus.custcode())
{ u=1;
cus.cname();
gotoxy(12,12);
{cout<<"ntCUSTOMER DETAIL:";
cout<<"nn"<<setw(8)<<"NAME"<<setw(6)<<"AGE"<<setw(5)<<"SEX"<<setw(14)
<<"ADDRESS"<<setw(14)<<"CITY"<<setw(11)<<"COUNTRY"<<setw(14)<<"CONTACT NO"
<<setw(7)<<"CCODE"<<endl<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cus.customers();
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cout<<"nntWE ARE HAVING SPECIAL DISCOUNT FOR OUR MEMBER!n";
cout<<"tYOU ARE GETTING 10 % DISCOUNT IN ORDERING THE DISHES";
getch();
}}
}
}
clrscr();
char r='Y';
do
{
gotoxy(10,10);
clreol();
cout<<"ENTER THE CODE OF THE ITEM ,YOU WANT TO PURCHASE : ";
cin>>s[c];
c++;
gotoxy(10,12);
clreol();
cout<<"DO YOU WANT TO PLACE YOUR ORDER AGAIN ? (Y/N)";
cin>>r;
10. }
while(r=='y'||r=='Y') ;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
for(int x=0;x<=c;x++)
{ ifstream finch;
finch.open("chinese",ios::binary) ;
finch.read((char*)&t,sizeof(t));
while(!finch.eof())
{
if(t.search()==s[x])
{t.show();
amt=t.price();
if(u==1)
{total=total+amt-(amt*0.2);
}
else
total+=amt;
}
finch.read((char*)&t,sizeof(t)) ;
}
}
cout<<"nnttamount to be paid is :"<<total;
getch();
clrscr();
goto U;
}
if(se=='2')
{ int u,co;
char q;
clrscr();
gotoxy(10,5);
cout<<"ARE YOU MEMBER OF OUR RESTAURANT(Y/N)n ";
cin>>q;
clrscr();
if(q=='y'||q=='Y')
{gotoxy(10,5);
cout<<"ENTER YOUR CCODE : ";
cin>>co;
ifstream fg;
fg.open("customer",ios::binary);
while(fg.read((char*)&cus,sizeof(cus)))
{if(co==cus.custcode())
{ u=1;
cus.cname();
gotoxy(12,12);
{cout<<"ntCUSTOMER DETAIL:";
cout<<"nn"<<setw(8)<<"NAME"<<setw(6)<<"AGE"<<setw(5)<<"SEX"<<setw(14)
<<"ADDRESS"<<setw(14)<<"CITY"<<setw(11)<<"COUNTRY"<<setw(14)<<"CONTACT NO"
<<setw(7)<<"CCODE"<<endl<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cus.customers();
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cout<<"nntWE ARE HAVING SPECIAL DISCOUNT FOR OUR MEMBER!n";
cout<<"tYOU ARE GETTING 10 % DISCOUNT IN ORDERING THE DISHES";
getch();
}}
}
}
clrscr();
11. char r='Y';
do
{
gotoxy(10,10);
clreol();
cout<<"ENTER THE CODE OF THE ITEM ,YOU WANT TO PURCHASE : ";
cin>>s[c];
c++;
gotoxy(10,12);
clreol();
cout<<"DO YOU WANT TO PLACE YOUR ORDER AGAIN ? (Y/N)";
cin>>r;
}
while(r=='y'||r=='Y') ;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
for(int x=0;x<=c;x++)
{ ifstream fim;
fim.open("mexican",ios::binary) ;
fim.read((char*)&t,sizeof(t));
while(!fim.eof())
{
if(t.search()==s[x])
{t.show();
amt=t.price();
if(u==1)
{total=total+amt-(amt*0.2);
}
else
total+=amt;
}
fim.read((char*)&t,sizeof(t)) ;
}
}
cout<<"nntttamount to be paid is :"<<total;
getch();
clrscr();
goto U;
}
if(se=='3')
{int u,co;
char q;
clrscr();
gotoxy(10,5);
cout<<"ARE YOU MEMBER OF OUR RESTAURANT(Y/N)n ";
cin>>q;
clrscr();
if(q=='y'||q=='Y')
{gotoxy(10,5);
cout<<"ENTER YOUR CCODE : ";
cin>>co;
ifstream fg;
fg.open("customer",ios::binary);
while(fg.read((char*)&cus,sizeof(cus)))
{if(co==cus.custcode())
{u=1;
cus.cname();
gotoxy(12,12);
{cout<<"ntCUSTOMER DETAIL:";
cout<<"nn"<<setw(8)<<"NAME"<<setw(6)<<"AGE"<<setw(5)<<"SEX"<<setw(14)
<<"ADDRESS"<<setw(14)<<"CITY"<<setw(11)<<"COUNTRY"<<setw(14)<<"CONTACT NO"
12. <<setw(7)<<"CCODE"<<endl<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cus.customers();
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cout<<"nntWE ARE HAVING SPECIAL DISCOUNT FOR OUR MEMBER!n";
cout<<"tYOU ARE GETTING 10 % DISCOUNT IN ORDERING THE DISHES";
getch();
}}
}}
clrscr();
char r='Y';
do
{
gotoxy(10,10);
clreol();
cout<<"ENTER THE CODE OF THE ITEM ,YOU WANT TO PURCHASE : ";
cin>>s[c];
c++;
gotoxy(10,12);
clreol();
cout<<"DO YOU WANT TO PLACE YOUR ORDER AGAIN ? (Y/N)";
cin>>r;
}
while(r=='y'||r=='Y') ;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
for(int x=0;x<=c;x++)
{ ifstream fii;
fii.open("indian",ios::binary) ;
fii.read((char*)&t,sizeof(t));
while(!fii.eof())
{
if(t.search()==s[x])
{t.show();
amt=t.price();
if(u==1)
{total=total+amt-(amt*0.2);
}
else
total+=amt;
}
fii.read((char*)&t,sizeof(t)) ;
}
}
cout<<"nntttamount to be paid is :"<<total;
getch();
clrscr();
goto U;
}
if(se=='4')
{int u,co;
char q;
clrscr();
gotoxy(10,5);
cout<<"ARE YOU MEMBER OF OUR RESTAURANT(Y/N)n ";
cin>>q;
clrscr();
if(q=='y'||q=='Y')
13. {gotoxy(10,5);
cout<<"ENTER YOUR CCODE : ";
cin>>co;
ifstream fg;
fg.open("customer",ios::binary);
while(fg.read((char*)&cus,sizeof(cus)))
{if(co==cus.custcode())
{ u=1;
cus.cname();
gotoxy(12,12);
{cout<<"ntCUSTOMER DETAIL:";
cout<<"nn"<<setw(8)<<"NAME"<<setw(6)<<"AGE"<<setw(5)<<"SEX"<<setw(14)
<<"ADDRESS"<<setw(14)<<"CITY"<<setw(11)<<"COUNTRY"<<setw(14)<<"CONTACT NO"
<<setw(7)<<"CCODE"<<endl<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cus.customers();
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~n";
cout<<"nntWE ARE HAVING SPECIAL DISCOUNT FOR OUR MEMBER!n";
cout<<"tYOU ARE GETTING 10 % DISCOUNT IN ORDERING THE DISHES";
getch();
}}
}
}
clrscr();
char r='Y';
do
{
gotoxy(10,10);
clreol();
cout<<"ENTER THE CODE OF THE ITEM ,YOU WANT TO PURCHASE : ";
cin>>s[c];
c++;
gotoxy(10,12);
clreol();
cout<<"DO YOU WANT TO PLACE YOUR ORDER AGAIN ? (Y/N)";
cin>>r;
}
while(r=='y'||r=='Y') ;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
for(int x=0;x<=c;x++)
{ ifstream fit;
fit.open("C:italian",ios::binary) ;
fit.read((char*)&t,sizeof(t));
while(!fit.eof())
{
if(t.search()==s[x])
{t.show();
amt=t.price();
if(u==1)
{total=total+amt-(amt*0.2);
}
else
total+=amt;
}
fit.read((char*)&t,sizeof(t)) ;
}
}
cout<<"nntttamount to be paid is :"<<total;
14. getch();
clrscr();
goto U;
}
break;
case '2': //*******TO SEE THE MENU******//
obj.read();
clrscr();
goto l;
break;
case '3': //********EDIT***************//
{gotoxy(10,7);
cout<<"PRESS 1 TO ADD DATA"<<"n";
gotoxy(10,9);
cout<<"PRESS 2 TO REMOVE DATA"<<"n";
gotoxy(10,11);
cout<<"PRESS 3 TO SEARCH DATA"<<"n";
gotoxy(10,13);
cout<<"PRESS 4 TO MODIFY DATA"<<"n";
gotoxy(10,20);
cout<<"nntENTER YOUR CHOICE"<<" : ";
o=getche();
clrscr();
switch(o)
{case '1': //*************TO ADD DATA******************//
gotoxy(21,4);
cout<<"ADDING OF DATA"<<"n";
obj.get();
getch();
clrscr();
goto l;
break;
case '2': //*********TO REMOVE DATA**************//
{int che;
gotoxy(31,7);
cout<<"REMOVING THE DATA"<<"n";
gotoxy(27,10);
cout<<"PRESS 1 FOR CHINESE DISHES"<<"n";
gotoxy(27,12);
cout<<"PRESS 2 FOR MEXICAN DISHES"<<"n";
gotoxy(27,14);
cout<<"PRESS 3 FOR INDIAN DISHES"<<"n";
gotoxy(27,16);
cout<<"PRESS 4 FOR ITALIAN DISHES"<<"nn";
gotoxy(27,18);
cout<<"ENTER YOUR CHOICE : ";
gotoxy(48,18);
che=getche();
clrscr();
if(che==9)
return;
if(che=='1') //******TO REMOVE CHINESE DISHES*********//
{
gotoxy(20,6);
int n;
cout<<"ENTER THE CODE,FOR WHICH DATA HAS TO BE REMOVED->";
cin>>n;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream rfinch;
rfinch.open("chinese",ios::binary) ;
16. goto l;
}
if(che=='3')
{
gotoxy(20,6);
int n;
cout<<"ENTER THE CODE,FOR WHICH DATA HAS TO BE REMOVED->";
cin>>n;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream rfini;
rfini.open("indian",ios::binary) ;
while(rfini.read((char*)&t,sizeof(t)))
{
if(t.search()==n)
t.show();
}
ofstream oi;
oi.open("nindian",ios::binary);
ifstream ii;
ii.open("indian",ios::binary);
while(ii.read((char*)&t,sizeof(t)))
{if(t.search()!=n)
oi.write((char*)&t,sizeof(t));
}
ii.close();
oi.close();
remove("indian");
rename("nindian","indian");
ifstream ifi;
ifi.open("indian",ios::binary);
while(ifi.read((char*)&t,sizeof(t)))
{t.show();
}
getch();
goto l;
}
if(che=='4')
{
gotoxy(20,6);
int n;
cout<<"ENTER THE CODE,FOR WHICH DATA HAS TO BE REMOVED->";
cin>>n;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream rfini;
rfini.open("italian",ios::binary) ;
while(rfini.read((char*)&t,sizeof(t)))
{
if(t.search()==n)
t.show();
}
ofstream oi;
oi.open("nitalian",ios::binary);
ifstream ii;
ii.open("italian",ios::binary);
while(ii.read((char*)&t,sizeof(t)))
17. {if(t.search()!=n)
oi.write((char*)&t,sizeof(t));
}
ii.close();
oi.close();
remove("italian");
rename("nitalian","italian");
ifstream ifi;
ifi.open("italian",ios::binary);
while(ifi.read((char*)&t,sizeof(t)))
{t.show();
}
goto l;
}
break;
}
case '3': //********TO SEARCH THE DATA*****************//
box();
int choice,a;
char opt;
gotoxy(31,7);
cout<<"SEARCHING THE DATA"<<"n";
gotoxy(27,10);
cout<<"PRESS 1 FOR CHINESE DISHES"<<"n";
gotoxy(27,12);
cout<<"PRESS 2 FOR MEXICAN DISHES"<<"n";
gotoxy(27,14);
cout<<"PRESS 3 FOR INDIAN DISHES"<<"n";
gotoxy(27,16);
cout<<"PRESS 4 FOR ITALIAN DISHES"<<"nn";
gotoxy(27,18);
cout<<"ENTER YOUR CHOICE : ";
gotoxy(48,18);
choice=getche();
clrscr();
if(choice==9)
return;
if(choice=='1') //********TO SEARCH CHINESE DISHES***********//
{k:
clrscr();
gotoxy(7,5);
cout<<"ENTER THE CODE ,YOU WANT TO SEARCH FOR : ";
cin>>a;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream finch;
finch.open("chinese",ios::binary) ;
while(finch.read((char*)&t,sizeof(t)))
{
if(t.search()==a)
t.show();
}gotoxy(7,14);
cout<<"PRESS y TO ENTER AGAIN ELSE ENTER n "<<"-->";
opt=getche();
if(opt=='y')
goto k;
else
{clrscr();
goto l;
}
18. }
else if(choice=='2') //************TO SEARCH MEXICAN DISHES********///
{t:
clrscr();
gotoxy(7,5);
cout<<"ENTER THE CODE ,YOU WANT TO SEARCH FOR : ";
cin>>a;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream finmh;
finmh.open("mexican",ios::binary) ;
while(finmh.read((char*)&t,sizeof(t)))
{
if(t.search()==a)
t.show();
}gotoxy(7,14);
cout<<"PRESS y TO ENTER AGAIN ELSE ENTER n "<<"-->";
opt=getche();
if(opt=='y')
goto t;
else
{clrscr();
goto l;
}
}
else if(choice=='3') //**************TO SEARCH INDIAN DISHES**************//
{m:
clrscr();
gotoxy(7,5);
cout<<"ENTER THE CODE ,YOU WANT TO SEARCH FOR : ";
cin>>a;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream finih;
finih.open("indian",ios::binary) ;
while(finih.read((char*)&t,sizeof(t)))
{
if(t.search()==a)
t.show();
}gotoxy(7,14);
cout<<"PRESS y TO ENTER AGAIN ELSE ENTER n "<<"-->";
opt=getche();
if(opt=='y')
goto m;
else
{clrscr();
goto l;
}
}
else if(choice=='4') //************TO SEARCH ITALIAN DISHES**************//
{h:
clrscr();
gotoxy(7,5);
cout<<"ENTER THE CODE ,YOU WANT TO SEARCH FOR : ";
cin>>a;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
ifstream finth;
finth.open("italian",ios::binary) ;
while(finth.read((char*)&t,sizeof(t)))
{
if(t.search()==a)
t.show();
}gotoxy(7,14);
19. cout<<"PRESS y TO ENTER AGAIN ELSE ENTER n "<<"-->";
opt=getche();
if(opt=='y')
goto h;
else
{clrscr();
goto l;
}
}
break;
case '4': //*********TO MODIFY THE DATA*************//
{ int choice,a;
char opt;
gotoxy(31,7);
cout<<"MODIFYING THE DATA"<<"n";
gotoxy(27,10);
cout<<"PRESS 1 FOR CHINESE DISHES"<<"n";
gotoxy(27,12);
cout<<"PRESS 2 FOR MEXICAN DISHES"<<"n";
gotoxy(27,14);
cout<<"PRESS 3 FOR INDIAN DISHES"<<"n";
gotoxy(27,16);
cout<<"PRESS 4 FOR ITALIAN DISHES"<<"nn";
gotoxy(27,18);
cout<<"ENTER YOUR CHOICE : ";
gotoxy(48,18);
choice=getche();
clrscr();
if(choice=='1') //******TO MODIFY CHINESE DISHES********///
{
clrscr();
gotoxy(7,5);
int d;
cout<<"ENTER THE CODE ,YOU WANT TO MODIFY : ";
cin>>d;
fstream mfinch;
mfinch.open("chinese",ios::binary|ios::in|ios::out) ;
int found=0;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
while(mfinch.read((char*)&t,sizeof(t)) && found==0)
{
if(t.search()==d)
{t.show();
cout<<"nEnter The New Details";
t.put();
int pos=-1*(sizeof(t));
mfinch.seekp(pos,ios::cur);
mfinch.write((char*)&t,sizeof(t));
found=1;
}
}
ifstream modc;
modc.open("chinese",ios::binary);
while(mfinch.read((char*)&t,sizeof(t)))
{t.show();
}
goto l;
}if(choice=='2') //******TO MODIFY MEXICAN DISHES********///
{
clrscr();
20. gotoxy(7,5);
int d;
cout<<"ENTER THE CODE ,YOU WANT TO MODIFY : ";
cin>>d;
fstream mfinm;
mfinm.open("mexican",ios::binary|ios::in|ios::out) ;
int found=0;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
while(mfinm.read((char*)&t,sizeof(t)) && found==0)
{
if(t.search()==d)
{t.show();
cout<<"nEnter The New Details";
t.put();
int pos=-1*(sizeof(t));
mfinm.seekp(pos,ios::cur);
mfinm.write((char*)&t,sizeof(t));
found=1;
}
}
ifstream modm;
modm.open("mexican",ios::binary);
while(mfinm.read((char*)&t,sizeof(t)))
{t.show();
} goto l;
}
if(choice=='3') //******TO MODIFY INDIAN DISHES********///
{
clrscr();
gotoxy(7,5);
int d;
cout<<"ENTER THE CODE ,YOU WANT TO MODIFY : ";
cin>>d;
fstream mfini;
mfini.open("indian",ios::binary|ios::in|ios::out) ;
int found=0;
cout<<"nnt"<<"ITEMS"<<"tttt"<<"CODE"<<"tt"<<"COST"<<"nn";
while(mfini.read((char*)&t,sizeof(t)) && found==0)
{
if(t.search()==d)
{t.show();
cout<<"nEnter The New Details";
t.put();
int pos=-1*(sizeof(t));
mfini.seekp(pos,ios::cur);
mfini.write((char*)&t,sizeof(t));
found=1;
}
}
ifstream modi;
modi.open("indian",ios::binary);
while(mfini.read((char*)&t,sizeof(t)))
{t.show();
}
goto l;
}
if(choice=='4') //******TO MODIFY ITALIAN DISHES********///
{
clrscr();
gotoxy(7,5);