B
begum
in my program ý want to use a help menu and i want to connect it with
a .txt file. in case 4 ý want to use fstream. how can i do it?
thank you.
#include <iostream>
#include<string.h>
using namespace std;
int main()
{ char lang;
int secim;
int n;
int pid=1||2||3||4||5;
int tid=1||2;
int amount;
cout<<"* INVENTORY MANAGEMENT SYSTEM *"<<endl;
cout<<"* [1] Product operations *"<<endl;
cout<<"* [2] Depot operations *"<<endl;
cout<<"* [3] Stock maintanence *"<<endl;
cout<<"* [4] Help *"<<endl;
cout<<"* [5] Exit *"<<endl;
cout<<"***********************************"<<endl;
cout<<"Enter your choice from above MENU:"<<endl;
cin>>secim;
switch(secim){
case 3:
cout<<"* Inventory management system *"<<endl;
cout<<"***********************************"<<endl;
cout<<"* STOCK MAiNTANENCE *"<<endl;
cout<<"Enter depotid="<<endl;
cin>>tid;
if(tid!=1||2)
cout<<"\a\a\a invalid depotid,please enter correct id"<<endl;
cin>>tid;
cout<<"Enter productid="<<endl;
cin>>pid;
if(pid!=1||2||3||3||4||5)
cout<<"\a\a\a invalid productid,please enter correct product
id"<<endl;
cin>>pid;
cout<<"Enter transaction amount="<<endl;
cin>>amount;
break;
case 5:
cout<<"Are you sure quit or continue"<<endl;
cin>> lang;
if(lang=='q'||lang=='Q')
break;
system("cls");
if(lang=='c'||lang=='C')
system("start");
}
return 0;
}
a .txt file. in case 4 ý want to use fstream. how can i do it?
thank you.
#include <iostream>
#include<string.h>
using namespace std;
int main()
{ char lang;
int secim;
int n;
int pid=1||2||3||4||5;
int tid=1||2;
int amount;
cout<<"* INVENTORY MANAGEMENT SYSTEM *"<<endl;
cout<<"* [1] Product operations *"<<endl;
cout<<"* [2] Depot operations *"<<endl;
cout<<"* [3] Stock maintanence *"<<endl;
cout<<"* [4] Help *"<<endl;
cout<<"* [5] Exit *"<<endl;
cout<<"***********************************"<<endl;
cout<<"Enter your choice from above MENU:"<<endl;
cin>>secim;
switch(secim){
case 3:
cout<<"* Inventory management system *"<<endl;
cout<<"***********************************"<<endl;
cout<<"* STOCK MAiNTANENCE *"<<endl;
cout<<"Enter depotid="<<endl;
cin>>tid;
if(tid!=1||2)
cout<<"\a\a\a invalid depotid,please enter correct id"<<endl;
cin>>tid;
cout<<"Enter productid="<<endl;
cin>>pid;
if(pid!=1||2||3||3||4||5)
cout<<"\a\a\a invalid productid,please enter correct product
id"<<endl;
cin>>pid;
cout<<"Enter transaction amount="<<endl;
cin>>amount;
break;
case 5:
cout<<"Are you sure quit or continue"<<endl;
cin>> lang;
if(lang=='q'||lang=='Q')
break;
system("cls");
if(lang=='c'||lang=='C')
system("start");
}
return 0;
}