Advertisement
Guest User

Untitled

a guest
May 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. case 5:
  2. cout << "\n\n\t\t\t Search Order\n";
  3. cout << "Which order do you want to search?\n";
  4. cout << "[1]MEAL\n[2]D­RINKS\n[3]DESSERT";
  5. cout << "\nChoose:";
  6. cin >> order;
  7. switch(order){//nested switch
  8. case 1:
  9. cout << "MEAL"<<endl;
  10. cout << "Enter code : ";
  11. cin>>search;
  12. for(int i=0; i<15; i++)
  13. {
  14. if(search==code[i])
  15. {
  16. cout <<"MEAL: " <<meal[i] <<"\n" <<"PRICE: " <<price[i] <<"\n";
  17. i=15;
  18.  
  19. }
  20.  
  21. }//loop case 1
  22. break;
  23. case 2:
  24. cout << "Drinks"<<endl;
  25. cout << "Enter code : ";
  26. cin>>search2;
  27. for(int i=0; i<15; i++)
  28. {
  29. if(search2==code2[i])
  30. {
  31. cout <<"DRINKS: " <<drinks[i] <<"\n" <<"PRICE: " <<price2[i] <<"\n";
  32. i=15;
  33.  
  34. }
  35.  
  36. }//loop case 2
  37. break;
  38. case 3:
  39. cout << "Dessert"<<endl;
  40. cout << "Enter code : ";
  41. cin>>search3;
  42. for(int i=0; i<15; i++)
  43. {
  44. if(search3==code3[i])
  45. {
  46. cout <<"DESSERT: " <<dessert[i] <<"\n" <<"PRICE: " <<price3[i] <<"\n";
  47. i=15;
  48.  
  49. }
  50.  
  51. }//loop case 3
  52. }//end of switch inside case 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement