Example #1
0
        static void PrintOrder(string menu, int[] currentOrder)
        {
            string[]  useMenu    = new string[20];
            decimal[] menuPrices = new decimal[20];
            if (menu.ToLower() == "breakfast")
            {
                useMenu    = Breakfast_Menu.BreakfastItems();
                menuPrices = Breakfast_Menu.BreakfastPrices();
            }
            else if (menu.ToLower() == "lunch")
            {
                useMenu    = Lunch_Menu.LunchItems();
                menuPrices = Lunch_Menu.LunchPrices();
            }
            else if (menu.ToLower() == "dinner")
            {
                useMenu    = Dinner_Menu.DinnerItems();
                menuPrices = Dinner_Menu.DinnerPrices();
            }

            WriteLine("Your order:");
            for (var i = 0; i < currentOrder.Length; i++)
            {
                int numItems = currentOrder[i];
                if (numItems != 0)
                {
                    WriteLine($"{numItems}   {useMenu[i]}{(menuPrices[i]*numItems):C2}");
                }
            }
        }
Example #2
0
 public static string[] FindMenuItems(string menu)
 {
     menu = menu.ToLower();
     string[] checkMenu = new string[20];
     if (menu == "breakfast")
     {
         checkMenu = Breakfast_Menu.BreakfastItems();
     }
     else if (menu == "lunch")
     {
         checkMenu = Lunch_Menu.LunchItems();
     }
     else if (menu == "dinner")
     {
         checkMenu = Dinner_Menu.DinnerItems();
     }
     return(checkMenu);
 }