Advertisement
Guest User

Untitled

a guest
May 25th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. #include<iostream>
  2. #include<ctime>
  3. #include<fstream>
  4.  
  5. using namespace std;
  6.  
  7. struct order
  8. {
  9. string name;
  10. float price;
  11. int size,quantity;
  12. }kasut;
  13.  
  14. int main()
  15. {
  16. time_t now = time(0);
  17. char* dt = ctime(&now);
  18. cout << dt << endl;
  19.  
  20. int button,option;
  21.  
  22. std::ifstream in;
  23. in.open("RegAdmin.txt", std::ifstream::in);
  24. std::ifstream inn;
  25. inn.open("CART.txt", std::ifstream::in);
  26. std::ofstream out;
  27. out.open ("RegAdmin.txt", std::ofstream::out | std::ofstream::app);
  28.  
  29. cout<<"\t********************************************************************************\n";
  30. cout<<"\t********************************************************************************\n";
  31. cout<<"\t AH.SNEAKERS.OUTLET\n";
  32. cout<<"\t********************************************************************************\n";
  33. cout<<"\t********************************************************************************\n\n\n";
  34.  
  35. cout<<"\t1.Order received \n";
  36. cout<<"\n\t2.Report analysis\n";
  37. cout<<"\n\t3.Add new admin";
  38. cout<<"\n\n\t99.Log out";
  39.  
  40. cout<<"\n\n\t>>> ";
  41. cin>>button;
  42.  
  43. switch(button)
  44. {
  45. case 1 :
  46. system("CLS");
  47. cout<<"\t********************************************************************************\n";
  48. cout<<"\t********************************************************************************\n";
  49. cout<<"\t AH.SNEAKERS.OUTLET\n";
  50. cout<<"\t********************************************************************************\n";
  51. cout<<"\t********************************************************************************\n\n\n";
  52.  
  53. if(in.fail())
  54. {
  55. cout<<"\n\tThere is no order for the shoe.";
  56. }
  57. while(!in.eof())
  58. {
  59. getline(inn,kasut.name,';');
  60. inn>>kasut.price>>kasut.size>>kasut.quantity;
  61. cout<<"\n\t"<<kasut.name<<" "<<kasut.size<<" "<<kasut.quantity<<" "<<kasut.price;
  62. inn>>ws;
  63. }
  64.  
  65. /*cout<<"\tOrder received(By Brand) \n";
  66. cout<<"\n\t1.NIKE ";
  67. cout<<"\n\t2.ADIDAS ";
  68. cout<<"\n\t3.VANS ";
  69. cout<<"\n\t4.FILA ";
  70. cout<<"\n\t5.TIMBERLAND ";
  71. cout<<"\n\t99.Back ";
  72. cout<<"\n\t\t>> ";
  73. cin>>option;
  74.  
  75. switch(option)
  76. {
  77. case 1 :
  78. if(in.fail())
  79. {
  80. cout<<"\n\tThere is no order for this shoe.";
  81. }
  82. else
  83. {
  84. while(!in.eof())
  85. {
  86. getline(inn,kasut.name);
  87. if(kasut.name=="NIKE")
  88. {
  89. getline(inn,kasut.name,';');
  90. inn>>kasut.price>>kasut.size>>kasut.quantity;
  91. cout<<"\n\t"<<kasut.name<<" "<<kasut.size<<" "<<kasut.quantity;
  92. }
  93.  
  94. }
  95. }
  96. //panggil file ORDERNIKE
  97. break;
  98. case 2:
  99. //panggil file ORDERADIDAS
  100. break;
  101. case 3:
  102. //panggil file ORDERVANS
  103. break;
  104. case 4:
  105. //panggil file ORDERFILA
  106. break;
  107. case 5:
  108. //panggil file ORDERTIMBERLAND
  109. break;
  110. case 99:
  111. ;
  112. }
  113. system("pause");
  114. main();*/
  115. case 2:
  116. // report();//panggil function REPORT capiq buat
  117. case 3:
  118. //panggil
  119. case 99:;
  120. //default;
  121.  
  122. }
  123.  
  124. inn.close();
  125. return 0;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement