Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- #include<fstream>
- using namespace std;
- struct order
- {
- string name;
- float price;
- int size,quantity;
- }kasut;
- int main()
- {
- time_t now = time(0);
- char* dt = ctime(&now);
- cout << dt << endl;
- int button,option;
- std::ifstream in;
- in.open("RegAdmin.txt", std::ifstream::in);
- std::ifstream inn;
- inn.open("CART.txt", std::ifstream::in);
- std::ofstream out;
- out.open ("RegAdmin.txt", std::ofstream::out | std::ofstream::app);
- cout<<"\t********************************************************************************\n";
- cout<<"\t********************************************************************************\n";
- cout<<"\t AH.SNEAKERS.OUTLET\n";
- cout<<"\t********************************************************************************\n";
- cout<<"\t********************************************************************************\n\n\n";
- cout<<"\t1.Order received \n";
- cout<<"\n\t2.Report analysis\n";
- cout<<"\n\t3.Add new admin";
- cout<<"\n\n\t99.Log out";
- cout<<"\n\n\t>>> ";
- cin>>button;
- switch(button)
- {
- case 1 :
- system("CLS");
- cout<<"\t********************************************************************************\n";
- cout<<"\t********************************************************************************\n";
- cout<<"\t AH.SNEAKERS.OUTLET\n";
- cout<<"\t********************************************************************************\n";
- cout<<"\t********************************************************************************\n\n\n";
- if(in.fail())
- {
- cout<<"\n\tThere is no order for the shoe.";
- }
- while(!in.eof())
- {
- getline(inn,kasut.name,';');
- inn>>kasut.price>>kasut.size>>kasut.quantity;
- cout<<"\n\t"<<kasut.name<<" "<<kasut.size<<" "<<kasut.quantity<<" "<<kasut.price;
- inn>>ws;
- }
- /*cout<<"\tOrder received(By Brand) \n";
- cout<<"\n\t1.NIKE ";
- cout<<"\n\t2.ADIDAS ";
- cout<<"\n\t3.VANS ";
- cout<<"\n\t4.FILA ";
- cout<<"\n\t5.TIMBERLAND ";
- cout<<"\n\t99.Back ";
- cout<<"\n\t\t>> ";
- cin>>option;
- switch(option)
- {
- case 1 :
- if(in.fail())
- {
- cout<<"\n\tThere is no order for this shoe.";
- }
- else
- {
- while(!in.eof())
- {
- getline(inn,kasut.name);
- if(kasut.name=="NIKE")
- {
- getline(inn,kasut.name,';');
- inn>>kasut.price>>kasut.size>>kasut.quantity;
- cout<<"\n\t"<<kasut.name<<" "<<kasut.size<<" "<<kasut.quantity;
- }
- }
- }
- //panggil file ORDERNIKE
- break;
- case 2:
- //panggil file ORDERADIDAS
- break;
- case 3:
- //panggil file ORDERVANS
- break;
- case 4:
- //panggil file ORDERFILA
- break;
- case 5:
- //panggil file ORDERTIMBERLAND
- break;
- case 99:
- ;
- }
- system("pause");
- main();*/
- case 2:
- // report();//panggil function REPORT capiq buat
- case 3:
- //panggil
- case 99:;
- //default;
- }
- inn.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement