Maruf_Hasan

Revised Addphone

Jun 25th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. void Admin::Add_phone()
  2. {
  3. cout<<"Enter The Types of Phone You want to Add"<<endl;
  4. cout<<"1.Featured phone"<<endl;
  5. cout<<"2.Midranged phone"<<endl;
  6. cout<<"3.Flagship phone"<<endl;
  7. cout<<"4.Appple Phone"<<endl;
  8. cout<<"0.Exit"<<endl;
  9. int choice;
  10. cin>>choice;
  11. if(choice==1)
  12. {
  13. int type=1;
  14. fin.open("Mobilelist.csv",ios::in|ios.app);
  15. cout<<"Enter the Brand of phone"<<endl;
  16. cin>>brand;
  17. cout<<"Enter the model of Phone"<<endl;
  18. cin>>model;
  19. cout<<"Enter the Price of phone"<<endl;
  20. cin>>price;
  21. cout<<"Enter the battery of phone"<<endl;
  22. cin>>battery;
  23. fout<<type<<","<<brand<<","<<price<<","<<model<<endl;
  24. }
  25. else
  26. {
  27. fstream fin;
  28. fin.open("Mobilelist.csv",ios::in|ios::app);
  29. string brand,networktype,displaytype,displaysize;
  30. string battery;
  31. string simtype,platform;
  32. string ram,rom;
  33. string price;
  34. string camera;
  35. string android_version,extmemory;
  36. cout<<"Enter the Name of Brand"<<endl;
  37. cin>>brand;
  38. cout<<"Enter The Details Below"<<endl;
  39. cout<<"battery"<<endl;
  40. cin>>battery;
  41. cout<<"Networktype"<<endl;
  42. cin>>networktype;
  43. cout<<"Display type and Displaysize"<<endl;
  44. cin>>displaytype>>displaysize;
  45. cout<<"Sim type"<<endl;
  46. cin>>simtype;
  47. cout<<"Platform"<<endl;
  48. getline(cin,platform);
  49. cout<<"Ram and Rom"<<endl;
  50. cin>>ram>>rom;
  51. getchar();
  52. cout<<"Enter Camera Details"<<endl;
  53. getline(cin,camera);
  54. cout<<"Android Version or Ios Version"<<endl;
  55. cin>>android_version;
  56. cout<<"External Memory"<<endl;
  57. cin>>extmemory;
  58. cout<<"Enter the price"<<endl;
  59. cin>>price;
  60. fin<<choice<<","<<brand<<","<<price<<","<<model<<","<<ram<<","<<rom<<","<<battery<<","<<camera<<","<<networktype<<","<<displaytype<<","<<displaysize<<","
  61. <<simtype<<","<<platform<<","<<android_version<<","<<extmemory<<endl;
  62. fin.close();
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment