Пример #1
0
        public static void MainMenu()
        {
            Console.WriteLine("please type in 'bread' for bread options or 'pastry' for pastry options.");
            string menuOption = Console.ReadLine().ToLower();

            if (menuOption == "bread")
            {
                Console.WriteLine("Todays specials! Buy 2, get 1 free. A single loaf costs $5.");
                Console.WriteLine("How many loafs would you like to order?");
                int   breadOrder      = int.Parse(Console.ReadLine());
                Bread newBreadOrder   = new Bread(breadOrder);
                int   firstBreadOrder = newBreadOrder.AddBreadCost();
                totalBreadList.Add(firstBreadOrder);
                Console.WriteLine($"Total: ${newBreadOrder.AddBreadCost()}");
                CheckOut();
            }
            else if (menuOption == "pastry")
            {
                Console.WriteLine("Todays specials! Buy 1 for $2 or 3 for $5.");
                Console.WriteLine("How many pastries would you like to order?");
                int    pastryOrder      = int.Parse(Console.ReadLine());
                Pastry newPastryOrder   = new Pastry(pastryOrder);
                int    firstPastryOrder = newPastryOrder.AddPastryItem();
                totalBreadList.Add(firstPastryOrder);
                Console.WriteLine($"Total: ${newPastryOrder.AddPastryItem()}");
                CheckOut();
            }
        }