Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- #include<cmath>
- using namespace std;
- //user-defined functions
- void printmessage()
- {
- //opening
- cout<< "\t\t\t\t******* WELCOME TO AN'S GORGEOUS CAFE ******"<<endl;
- cout<<"\n";
- cout<<"\n";
- }
- int main()
- {
- //variable declaration
- char name[10], pizza1[]="Chicken Aloha" ,pizza2[]="Prawn Sensation" ,pizza3[]="Flamming Tuna" ,pizza4[]="Vegie Pasta"; //array
- char dessert1[]="Blueberry Cheesecake",dessert2[]="Chocolate Lava Cake",dessert3[]="Almond Brownies"; //array
- char drink1[]="Mango", drink2[]="Coke", drink3[]="Ice Lemon Tea", drink4[]="Milo", gotostart ; //array
- int homeno[4];
- int choice, pchoice,pchoice1, quantity;
- double price;
- static int totalSales=0;
- int phone[11];
- printmessage();
- cout<< "Please enter your details: - " << endl;
- cout<<"Name: ";
- cin.getline (name,10);
- cout<< "\nHome no: " ;
- cin>>homeno[4];
- cout<< "\nPhone Number: ";
- cin>>phone[11];
- beginning:
- system("CLS");
- cout<<"\nHello "<<name<< "!"<<"\n\nWhat would you like to order?\n\n";
- cout<<"\t\t\t\t\t --------MENU--------\n\n";
- cout<<setw(50)<<"1) Pizza\n";
- cout<<setw(52)<<"2) Dessert\n";
- cout<<setw(51)<<"3) Drink\n\n";
- cout<<"\nPlease Enter your Choice: ";
- cin>> choice;
- if(choice==1)
- {
- cout<< setw(44) << "1) "<<pizza1<<"\n";
- cout<< setw(44) << "2) "<<pizza2<<"\n";
- cout<< setw(44) << "3) "<<pizza3<<"\n";
- cout<< setw(44) << "4) "<<pizza4<<"\n";
- do{
- cout<<"\nPlease Enter which Flavour would you like to have?:";
- cin>>pchoice;
- }while(pchoice!=1 && pchoice!=2 && pchoice!=3 && pchoice!=4); //Will keep looping if User key in invalid input >4
- if(pchoice>=1 && pchoice<=5)
- {
- cout<< "\n" << setw(60) <<"1) Small RM: 15.90\n"<< setw(61) <<"2) Regular RM:32.90\n"<<setw(60) <<"3) Large RM: 44.90\n";
- cout<< "\nChoose Size Please:";
- cin>>pchoice1;
- if(pchoice1>=1 && pchoice1<=3)
- cout<<"\nPlease Enter Quantity: ";
- cin>>quantity;
- switch(pchoice1)
- {
- case 1: price = 15.90*quantity;
- break;
- case 2: price = 32.90*quantity;
- break;
- case 3: price = 44.90*quantity;
- break;
- }
- cout << pizza1 ;
- system("CLS");
- switch (pchoice1)
- {
- case 1:
- cout<<"\t\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<pizza1;
- cout<<"\nYour Total Price is"<< " " << "RM " << price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 2:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<pizza2;
- cout<<"\nYour Total Price is "<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 3:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<pizza3;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 4:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<pizza4;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- }
- cout<<"\nWould you like to order anything else? Y / N:";
- cin>>gotostart;
- if(gotostart=='Y' || gotostart=='y')
- {
- goto beginning;
- //return 0;
- }
- }
- }
- else if(choice==2)
- {
- cout<<setw(44)<<"1) "<<dessert1<<" RM: 12.80"<<"\n";
- cout<<setw(44)<<"2) "<<dessert2<<" RM: 10.80"<<"\n";
- cout<<setw(44)<<"3) "<<dessert3<<" RM: 9.80"<<"\n";
- cout<<"\nPlease Enter which Dessert you would like to have?:";
- cin>>pchoice1;
- if(pchoice1>=1 && pchoice1<=3)
- {
- cout<<"\nPlease Enter Quantity: ";
- cin>>quantity;
- switch(pchoice1)
- {
- case 1: price = 12.80*quantity;
- break;
- case 2: price = 10.80*quantity;
- break;
- case 3: price = 9.80*quantity;
- break;
- }
- system("CLS");
- switch (pchoice1)
- {
- case 1:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<dessert1;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 2:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<dessert2;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 3:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<dessert3;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- }
- cout<<"\nWould you like to order anything else? Y / N:";
- cin>>gotostart;
- if(gotostart=='Y' || gotostart=='y')
- {
- goto beginning;
- //return 0;
- }
- }
- }
- else if(choice==3)
- {
- cout<<setw(44)<<"1) "<<drink1<<" RM:3.00"<<"\n";
- cout<<setw(44)<<"2) "<<drink2<<" RM:2.00"<<"\n";
- cout<<setw(44)<<"3) "<<drink3<<" RM:1.50"<<"\n";
- cout<<setw(44)<<"4) "<<drink4<<" RM:2.50"<<"\n";
- cout<<"\nPlease Enter which Drinks you would like to have?:";
- cin>>pchoice1;
- if(pchoice1>=1 && pchoice1<=4)
- {
- cout<<"\nPlease Enter Quantity: ";
- cin>>quantity;
- switch(pchoice1)
- {
- case 1: price = 3.00*quantity;
- break;
- case 2: price = 2.00*quantity;
- break;
- case 3: price = 1.50*quantity;
- break;
- case 4: price = 2.50*quantity;
- break;
- }
- system("CLS");
- switch (pchoice1)
- {
- case 1:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<drink1;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 2:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<drink2;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 3:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<drink3;
- cout<<"\nYour Total Price is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- case 4:
- cout<<"\t\t--------Your Order---------\n";
- cout<<""<<quantity<<" "<<drink4;
- cout<<"\nYour Total Bill is"<< " " << "RM " <<price<<"\nYour Order Will be delivered in 40 Minutes";
- break;
- }
- cout<<"\nWould you like to order anything else? Y / N:";
- cin>>gotostart;
- if(gotostart=='Y' || gotostart=='y')
- {
- goto beginning;
- //return 0;
- }
- }
- //Price = pchoice1 * pchoice1;
- //cout<<"Your total price is: ";
- //cout<<"\nThank you For Ordering From AN's Gourgeous Cafe\n";
- }
- else
- {
- system("CLS");
- cout<<"Please Select Right Option: \n";
- cout<<"Would You like to Start the program again? Y / N: " ;
- cin>>gotostart;
- if(gotostart=='Y' || gotostart=='y')
- {
- goto beginning;
- //return 0;
- }
- }
- totalSales=totalSales+price;
- void showSales() ;
- //closing
- cout<<"\n..............................................................";
- cout<<"\n";
- cout<<"\n";
- cout<<"Thank you For Ordering From AN's Gourgeous Cafe\n";
- cout<<"We promise for the best services";
- cout<<"\n\t PLEASE DO COME AGAIN\n\n\n"<<endl;
- system("pause");
- return 0;
- }
- // void showSales()
- //{
- // cout<< "Total sales: " << endl;
- // cout<< totalSales << endl << endl;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement