Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Admin::Add_phone()
- {
- cout<<"Enter The Types of Phone You want to Add"<<endl;
- cout<<"1.Featured phone"<<endl;
- cout<<"2.Midranged phone"<<endl;
- cout<<"3.Flagship phone"<<endl;
- cout<<"4.Appple Phone"<<endl;
- cout<<"0.Exit"<<endl;
- int choice;
- cin>>choice;
- if(choice==1)
- {
- int type=1;
- fin.open("Mobilelist.csv",ios::in|ios.app);
- cout<<"Enter the Brand of phone"<<endl;
- cin>>brand;
- cout<<"Enter the model of Phone"<<endl;
- cin>>model;
- cout<<"Enter the Price of phone"<<endl;
- cin>>price;
- cout<<"Enter the battery of phone"<<endl;
- cin>>battery;
- fout<<type<<","<<brand<<","<<price<<","<<model<<endl;
- }
- else
- {
- fstream fin;
- fin.open("Mobilelist.csv",ios::in|ios::app);
- string brand,networktype,displaytype,displaysize;
- string battery;
- string simtype,platform;
- string ram,rom;
- string price;
- string camera;
- string android_version,extmemory;
- cout<<"Enter the Name of Brand"<<endl;
- cin>>brand;
- cout<<"Enter The Details Below"<<endl;
- cout<<"battery"<<endl;
- cin>>battery;
- cout<<"Networktype"<<endl;
- cin>>networktype;
- cout<<"Display type and Displaysize"<<endl;
- cin>>displaytype>>displaysize;
- cout<<"Sim type"<<endl;
- cin>>simtype;
- cout<<"Platform"<<endl;
- getline(cin,platform);
- cout<<"Ram and Rom"<<endl;
- cin>>ram>>rom;
- getchar();
- cout<<"Enter Camera Details"<<endl;
- getline(cin,camera);
- cout<<"Android Version or Ios Version"<<endl;
- cin>>android_version;
- cout<<"External Memory"<<endl;
- cin>>extmemory;
- cout<<"Enter the price"<<endl;
- cin>>price;
- fin<<choice<<","<<brand<<","<<price<<","<<model<<","<<ram<<","<<rom<<","<<battery<<","<<camera<<","<<networktype<<","<<displaytype<<","<<displaysize<<","
- <<simtype<<","<<platform<<","<<android_version<<","<<extmemory<<endl;
- fin.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment