Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <iomanip>
- using namespace std;
- class Bank
- {
- public :
- string email;
- string pass;
- string adress;
- double account; //add money
- double getaccount()
- {
- return account;
- }
- virtual void getadress2()//virtual
- {
- }
- };
- /*#########################################################################################*/
- class btcoin : public Bank //inheritance
- {
- private:
- Bank bank;//composition
- public:
- btcoin(){
- }
- void getadress2()//function that can be use from bank
- {
- hevar://goto
- cout<<"send money to one pf these adress: \n";/*adress for the user, the user must send money to one of these adress if they send the money they will wright that adress*/
- cout<<"1J9JNPJ6nZ19EnanQMfmReSyFFq7j9ZxuF\n"<< endl; /*that they send money*/
- cout<<"1HcK14bPd3cs1ztNpwK79b7vwDEN5jysgA\n"<< endl;
- cout<<"3EKTujhztuB3XM4aSakb9idiTU3JdgHh1x\n"<< endl;
- cout<<"3AcLpcDX3xHAUdUvZLn6Xsyk4w6bUMkVu6\n\n\n"<< endl;
- cin>>bank.adress;//wright one of these adress
- if(bank.adress!="1J9JNPJ6nZ19EnanQMfmReSyFFq7j9ZxuF" && bank.adress!="1HcK14bPd3cs1ztNpwK79b7vwDEN5jysgA" //btcoin adress u have to send money to one of these adress
- && bank.adress!="3EKTujhztuB3XM4aSakb9idiTU3JdgHh1x" & bank.adress!="3AcLpcDX3xHAUdUvZLn6Xsyk4w6bUMkVu6" )//the program say error and start again
- {
- cout<<"\n----------------------------";
- cout<<"\n\nError 404 \n";
- goto hevar;
- }
- cout<<endl;
- }
- };
- /*##################################################################*/
- class paypal : public Bank //inheritance
- {
- private:
- Bank bank;//composition
- public:
- paypal(){}
- void getadress2() //function that can be use from bank
- {
- cout<<"Please write your email : \n>";//in paypal you just have to wright your email and password it will automatically send the money
- cin.ignore();
- getline(cin,bank.email);
- cout<<endl;
- cout<<"Please write your pass :\n>";
- cin.ignore();
- getline(cin,bank.pass);
- cout<<endl;
- }
- };
- /*################################################################################################*/
- class Menu
- {
- string dish1 , dish2 , dish3 , dish4 , dish5;//menu of the food
- double cost1 , cost2 ,cost3 , cost4 , cost5 ;//cost of the food
- public :
- Menu(string d1="None" , string d2="None" , string d3="None" , string d4="None" ,string d5="None" ,//default
- double c1=00 , double c2=00 , double c3=00 , double c4=00 , double c5=00)//default
- {
- dish1=d1;
- dish2=d2;
- dish3=d3;
- dish4=d4;
- dish5=d5;
- cost1=c1;
- cost2=c2;
- cost3=c3;
- cost4=c4;
- cost5=c5;
- }
- //accessor menu
- string getdish1()
- {
- return dish1;
- }
- string getdish2()
- {
- return dish2;
- }
- string getdish3()
- {
- return dish3;
- }
- string getdish4()
- {
- return dish4;
- }
- string getdish5()
- {
- return dish5;
- }
- //////////////////accessor cost
- double getcost1()
- {
- return cost1;
- }
- double getcost2()
- {
- return cost2;
- }
- double getcost3()
- {
- return cost3;
- }
- double getcost4()
- {
- return cost4;
- }
- double getcost5()
- {
- return cost5;
- }
- friend ostream &operator<<(ostream &out , Menu &m)//display the menu
- {
- out<<"\n\n------------Menu------------------------------------\n\n";
- out<<"Number"<<setw(15)<<"Dishes"<<setw(20)<<"Price"<<endl<<endl;
- out<<"1-"<<setw(20)<<m.dish1<<setw(18)<<m.cost1<<"$"<<endl;
- out<<"2-"<<setw(20)<<m.dish2<<setw(19)<<m.cost2<<"$"<<endl;
- out<<"3-"<<setw(20)<<m.dish3<<setw(18)<<m.cost3<<"$"<<endl;
- out<<"4-"<<setw(20)<<m.dish4<<setw(18)<<m.cost4<<"$"<<endl;
- out<<"5-"<<setw(20)<<m.dish5<<setw(18)<<m.cost5<<"$"<<endl;
- }
- };
- /*#####################################################################################################################*/
- class Staff
- {
- private :
- string name;
- int age;
- double salary;
- public :
- Staff(string n , int a , double s)//constructor
- {
- name=n;
- age=a;
- salary=s;
- }
- //accessor
- string getname()
- {
- return name;
- }
- int getage()
- {
- return age;
- }
- double getsalary()
- {
- return salary;
- }
- };
- /*#####################################################################################################################*/
- class Restaurant
- {
- public :
- Menu menu; //composition
- Bank bank; //composition
- Staff *s; //aggregation
- Restaurant(string d1,string d2,string d3,string d4,string d5 //constructor
- ,double c1 ,double c2,double c3,double c4,double c5) : menu(d1,d2,d3,d4,d5,c1,c2,c3,c4,c5)
- { }
- Restaurant ()//constructor
- {
- }
- void setpointer(Staff *R)//to set pointer
- {
- s=R;
- }
- void getMenu()//display menu
- {
- cout<<menu;
- }
- void getstaff()
- {
- cout<<s->getname()<<setw(20)<<s->getage()<<setw(20)<<s->getsalary()<<endl;//display the staff information
- }
- };
- /*#####################################################################################################################*/
- class Costumer
- {
- private :
- string name;
- string adress;
- string phone;
- string comment;
- Bank *bank;//aggregation
- public:
- //just for print
- void getinput()
- {
- int walam;
- cout<<"1.paypal or 2.cash or 3.bitcoin\n";//for the user if the want in which way they want to pay
- cin>>walam;
- if(walam==1)
- {
- bank = new paypal ;//paypal
- bank->getadress2(); //display function getadress2 in fuction getinput
- }
- if(walam==2)
- {
- cout<<"Please put your name \n>";//cash
- cin.ignore();
- getline(cin,name);
- cout<<endl;
- cout<<"Please put your adress :\n>";
- cin.ignore();
- getline(cin,adress);
- cout<<endl;
- cout<<"Please put you phone number so we call incase something went wrong :\n>";
- cin.ignore();
- getline(cin,phone);
- cout<<"Any details about your food ?\n>";
- cin.ignore();
- getline(cin,comment);
- }
- if(walam==3)
- {
- bank = new btcoin ;//btcoin
- bank->getadress2(); //display function getadress2 in fuction getinput
- }
- }
- //monitors
- void setname(string n)
- {
- name=n;
- }
- void setage(string a)
- {
- adress=a;
- }
- void setphone(string p)
- {
- phone=p;
- }
- };
- ///////////////////////////////////////////////////////////////////////////////
- int main()
- {
- int ccount=0;
- double x;
- string answer1, answer , order;
- Restaurant kurdish_restaurant("Dolma","Sarwpe","Kfta","Bryany","Shfta",9,15,8,7,5);//menu & cost of kurdish resturant
- Restaurant fastfood_restaurant("Burger","Shwarma","Finger","Saj","Pizza",3,2,1,3,6);//menu & cost of fastt resturant
- Restaurant mixed_restaurant("Rice and Soup","BBQ Meat","BBQ Chicken","Salad","Kebab",2,3,4,3,4);//menu & cost of mixed resturant
- Costumer costumer[100];
- Staff *staffs[3]={new Staff("hama ",18,500) , new Staff("hevar ",19,600),new Staff("paywand",12,100)};//staff information
- Restaurant R;
- cout<<"\twelcome to vikings delivery";
- cout<<"\n\t Free Delivery ;)\n\n";
- cout<<"Our staff members are :\n\n";
- //iomanip
- cout<<"Name"<<setw(24)<<"Age"<<setw(20)<<"Salary"<<endl;
- for(int i=0;i<3;i++)//for loop
- {
- R.setpointer(staffs[i]);//display staff
- R.getstaff();
- }
- cout<<endl<<endl;
- choose://goto
- cout<<"Which restaurant do you want to choose ?\n\n";
- cout<<"1- Kurdish food \n";
- cout<<"2- Fast food\n";
- cout<<"3- Mixed food\n>";
- cin>>answer;
- if(answer=="1")//if for cin >>answer
- {
- cout<<"\n\nWelcome to kurdish restaurant <3\n\n";
- again://goto
- kurdish_restaurant.getMenu();//display menu
- cout<<"\n\nWhat do you want to order\n>";
- cin>>order;
- if(order=="1")
- {
- x+=kurdish_restaurant.menu.getcost1();//sum the cost
- kurdish_restaurant.bank.account+=x;//store the cost
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again;
- }
- if(answer1=="2")
- { //display the total cost
- cout<<"\n\nIt will cost you : "<<kurdish_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();//display getinput function
- cout<<"Thank you for ordering food at kurdish restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose; //when the user right down 3 which is different restaurant it will go to (choose:) i use goto instead of do - while it's more easier but not accurate every time
- }
- }
- if(order=="2")
- {
- x+=kurdish_restaurant.menu.getcost2();
- kurdish_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again;
- }
- if(answer1=="2")
- {cout<<"\n\nIt will cost you : "<<kurdish_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at kurdish restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="3")
- {
- x+=kurdish_restaurant.menu.getcost3();
- kurdish_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again;
- }
- if(answer1=="2")
- {cout<<"\n\nIt will cost you : "<<kurdish_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at kurdish restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="4")
- {
- x+=kurdish_restaurant.menu.getcost4();
- kurdish_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again;
- }
- if(answer1=="2")
- {cout<<"\n\nIt will cost you : "<<kurdish_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at kurdish restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="5")
- {
- x+=kurdish_restaurant.menu.getcost5();
- kurdish_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again;
- }
- if(answer1=="2")
- {cout<<"\n\nIt will cost you : "<<kurdish_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"\n\nThank you for ordering food at kurdish restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- }
- if(answer=="2")
- {
- cout<<"\nWelcome to fast food restaurant \n\n";
- again2:
- fastfood_restaurant.getMenu();
- cout<<"\n\nWhat do you want to order\n>";
- cin>>order;
- if(order=="1")
- {
- x+=fastfood_restaurant.menu.getcost1();
- fastfood_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again2;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<fastfood_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="2")
- {
- x+=fastfood_restaurant.menu.getcost2();
- fastfood_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again2;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<fastfood_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="3")
- {
- x+=fastfood_restaurant.menu.getcost3();
- fastfood_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (yes/no/different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again2;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<fastfood_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="4")
- {
- x+=fastfood_restaurant.menu.getcost4();
- fastfood_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again2;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<fastfood_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="5")
- {
- x+=fastfood_restaurant.menu.getcost5();
- fastfood_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again2;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<fastfood_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"\n\nThank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- }
- if(answer=="3")
- {
- cout<<"\nWelcome to fast food restaurant \n\n";
- again3:
- mixed_restaurant.getMenu();
- cout<<"\n\nWhat do you want to order\n>";
- cin>>order;
- if(order=="1")
- {
- x+=mixed_restaurant.menu.getcost1();
- mixed_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again3;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<mixed_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at mixed restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="2")
- {
- x+=mixed_restaurant.menu.getcost2();
- mixed_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again3;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<mixed_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="3")
- {
- x+=mixed_restaurant.menu.getcost3();
- mixed_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again3;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<mixed_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at fast food restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="4")
- {
- x+=mixed_restaurant.menu.getcost4();
- mixed_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again3;
- }
- if(answer1=="2")
- {
- cout<<"\n\nIt will cost you : "<<mixed_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"Thank you for ordering food at mixed restaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- if(order=="5")
- {
- x+=mixed_restaurant.menu.getcost5();
- mixed_restaurant.bank.account+=x;
- cout<<"Do you want to order something else (1.yes/2.no/3.different restaurant)?\n";
- cin.ignore();
- getline(cin,answer1);
- if(answer1=="1")
- {
- goto again3;
- }
- if(answer1=="2")
- {cout<<"\n\nIt will cost you : "<<mixed_restaurant.bank.account<<"$"<<endl<<endl;
- costumer[ccount].getinput();
- cout<<"\n\nThank you for ordering food at mixedrestaurant \nyour food will be there in 30 minutes :)\nbye untill next time ...\n";
- }
- if(answer1=="3")
- {
- goto choose;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement