Я работаю над своей программой под названием "система заказа еды". Это дает мне некоторые ошибки, как я их исправляю?
#include<iostream> #include<conio.h> using namespace std; class pizza { public: int choice=0; int pchoice,pchoice1, quantity; char pizza1='Chicken Fajita' ,pizza2='Chicken Bar BQ' ,pizza3='Chicken Tikka' ,pizza4='Chicken Cheese'; int getdata() { cout<<"1) "<<pizza1<<endl; cout<<"2) "<<pizza2<<endl; cout<<"3) "<<pizza3<<endl; cout<<"4) "<<pizza4<<endl<<endl; cout<<"Please Enter which Flavour would you like to have? : "; cin>>pchoice; cout<<endl; if(pchoice>=1 && pchoice<=5) { cout<<"1) Small Rs.250"<<endl; cout<<"2) Regular Rs.500"<<endl; cout<<"3) Large Rs.900"<<endl<<endl; cout<<"Choose Size of Pizza Please : "; cin>>pchoice1; if(pchoice1>=1 && pchoice1<=3) cout<<endl; cout<<"Please Enter Quantity: "; cin>>quantity; switch(pchoice1) { case 1: choice = 250*quantity; break; case 2: choice = 500*quantity; break; case 3: choice = 900*quantity; break; } system("CLS"); switch (pchoice1) { case 1: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<pizza1<<endl; cout<<"Your Total Bill is"<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"; cout<<endl<<endl; cout<<"------Thank you For Ordering From Niba and Rohma Fast Food------"<<endl; break; case 2: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<pizza2<<endl;; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"; cout<<endl<<endl; cout<<"------Thank you For Ordering From Niba and Rohma Fast Food------"<<endl; break; case 3: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<pizza3<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"; cout<<endl<<endl; cout<<"------Thank you For Ordering From Niba and Rohma Fast Food------"<<endl; break; case 4: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<pizza4<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"; cout<<endl<<endl; cout<<"------Thank you For Ordering From Niba and Rohma Fast Food------"<<endl; break; } cout<<"Would you like to order anything else? Y / N:"; cin>>gotostart; if(gotostart=='Y' || gotostart=='y') { goto beginning; //return 0; } } } }; class burger { public: int choice=0; int pchoice,pchoice1, quantity; char bur1='Zinger Burger',bur2='Chicken Burger',bur3='Beef Burger'; int getdata() { cout<<"1) "<<bur1<<" Rs.100"<<endl; cout<<"2) "<<bur2<<" Rs.150"<<endl; cout<<"3) "<<bur3<<" Rs.200"<<endl; cout<<"Please Enter which Burger you would like to have?: "; cin>>pchoice1; if(pchoice1>=1 && pchoice1<=3) { cout<<endl; cout<<"Please Enter Quantity: "; cin>>quantity; switch(pchoice1) { case 1: choice = 100*quantity; break; case 2: choice = 150*quantity; break; case 3: choice = 200*quantity; break; } system("CLS"); switch (pchoice1) { case 1: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bur1<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 40 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; case 2: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bur2<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 40 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; case 3: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bur3<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 40 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; } cout<<endl; cout<<"Would you like to order anything else? Y / N:"; cin>>gotostart; if(gotostart=='Y' || gotostart=='y') { goto beginning; //return 0; } } } }; class sandwich { public: int choice=0; int pchoice,pchoice1, quantity; char sand1='Club Sandwich', sand2='Chicken Crispy Sandwich', sand3='Extream Veg Sandwich'; int getdata() { cout<<endl; cout<<"1) "<<sand1<<" Rs.240"<<endl; cout<<"2) "<<sand2<<" Rs.160"<<endl; cout<<"3) "<<sand3<<" Rs.100"<<endl<<endl; cout<<"Please Enter which Sandwich you would like to have? : "; cin>>pchoice1; if(pchoice1>=1 && pchoice1<=3) { cout<<endl; cout<<"Please Enter Quantity: "; cin>>quantity; switch(pchoice1) { case 1: choice = 240*quantity; break; case 2: choice = 160*quantity; break; case 3: choice = 100*quantity; break; } system("CLS"); switch (pchoice1) { case 1: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<sand1<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 50 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; case 2: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<sand2<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 50 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; case 3: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<sand3<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 50 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; } cout<<"Would you like to order anything else? Y / N:"; cin>>gotostart; if(gotostart=='Y' || gotostart=='y') { goto beginning; //return 0; } } } }; class roll { public: int choice=0; int pchoice,pchoice1, quantity; char roll1='Chicken Chatni Roll', roll2='Chicken Mayo Roll', roll3='Veg Roll With Fries'; int getdata() { cout<<"1) "<<roll1<<" Rs.150"<<endl; cout<<"2) "<<roll2<<" Rs.100"<<endl; cout<<"3) "<<roll3<<" Rs.120"<<endl<<endl; cout<<"Please Enter which you would like to have?: "; cin>>pchoice1; if(pchoice1>=1 && pchoice1<=3) { cout<<endl; cout<<"How Much Rolls Do you want: "; cin>>quantity; switch(pchoice1) { case 1: choice = 150*quantity; break; case 2: choice = 100*quantity; break; case 3: choice = 120*quantity; break; } system("CLS"); switch (pchoice1) { case 1: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<roll1<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 60 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; case 2: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<roll2<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 60 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; case 3: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<roll3<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 60 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food"<<endl; break; } } } }; class biryani { public: int choice=0; int pchoice,pchoice1, quantity; char bir1='Chicken Biryani', bir2='Sindhi Biryani', bir3='Beef Biryani'; int getdata() { cout<<"1) "<<bir1<<" Rs.160"<<endl; cout<<"2) "<<bir2<<" Rs.220"<<endl; cout<<"3) "<<bir3<<" Rs.140"<<endl<<endl; cout<<"Please Enter which Biryani you would like to have?:"; cin>>pchoice1; if(pchoice1>=1 && pchoice1<=3) { cout<<endl; cout<<"Please Enter Quantity: "; cin>>quantity; switch(pchoice1) { case 1: choice = 160*quantity; break; case 2: choice = 220*quantity; break; case 3: choice = 140*quantity; break; } system("CLS"); switch (pchoice1) { case 1: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bir1<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food "<<endl; break; case 2: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bir2<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food "<<endl; break; case 3: cout<<"\t\t--------Your Order---------"<<endl; cout<<""<<quantity<<" "<<bir3<<endl; cout<<"Your Total Bill is "<<choice<<endl<<"Your Order Will be delivered in 30 Minutes"<<endl; cout<<"Thank you For Ordering From NibA and Rohma Fast Food "<<endl; break; } cout<<"Would you like to order anything else? Y / N:"; cin>>gotostart; if(gotostart=='Y' || gotostart=='y') { goto beginning; //return 0; } } } }; class food { private: char name[30]; int choice=0; int pchoice,pchoice1, quantity; pizza p; burger b; sandwich s; roll r; biryani bi; public: int getdata() { beginning: system("CLS"); cout<<"\t\t----------NibA and Rohma Fast Food-----------"<<endl<<endl; cout<<"Please Enter Your Name: "; cin>>name; cout<<"Hello "<<name<<endl<<"What would you like to order?"<<endl<<endl; cout<<"\t--------Menu--------"<<endl<<endl; cout<<"1) Pizzas"<<endl; cout<<"2) Burgers"<<endl; cout<<"3) Sandwich"<<endl; cout<<"4) Rolls"<<endl; cout<<"5) Biryani"<<endl; cout<<endl; cout<<"Please Enter your Choice: "; cin>>choice; if(choice==1) { p.getdata(); } else if(choice==2) { b.getdata(); } else if(choice==3) { s.getdata(); } else if(choice==4) { r.getdata(); } else if(choice==5) { bi.getdata(); } else { system("CLS"); cout<<"Please Select Right Option: "<<endl; cout<<"Would You like to Start the program again? Y / N: " ; cin>>gotostart; if(gotostart=='Y' || gotostart=='y') { goto beginning; //return 0; } } } }; int main() { food f; f.getdata(); getch(); }
Что я уже пробовал:
код выдает мне эти ошибки:
1. [предупреждение] переполнение при неявном преобразовании констант [-Woverflow]
2. [Ошибка] 'gotostart' не был объявлен в этой области
3. [ошибка] метка "начало" используется, но не определена>
4. [предупреждение] нестатические инициализаторы элементов данных доступны только с-std=c++11 или -std=gnu++11