Пример #1
0
        public static void Main()
        {
            Bread  breadOrder  = new Bread();
            Pastry pastryOrder = new Pastry();

            LoadScreen();
            bool checkout = false;

            while (checkout == false)
            {
                bool menuInput = Menu(breadOrder, pastryOrder);
                if (menuInput == true)
                {
                    checkout = true;
                }
            }
        }
Пример #2
0
        public static void AddMultipleBread(string quantity, Bread bread)
        {
            int  qty        = 1;
            bool canConvert = int.TryParse(quantity, out qty);

            if (canConvert)
            {
                for (int i = 0; i < qty; i++)
                {
                    ShoppingCart.AddBread(bread);
                }
                Console.WriteLine($"\n*** {qty.ToString()} {bread.Description}s added! ***");
            }
            else
            {
                Console.WriteLine("\n*** Sorry please try again...type the NUMBER of the item you want, followed by quantity. Type 'm' to see the menu. ***");
            }
        }
Пример #3
0
        public static void Main()
        {
            Console.Clear();
            Bread  bread  = new Bread();
            Pastry pastry = new Pastry();

            Console.ForegroundColor = ConsoleColor.Red;
            TypeLine("Please Enter Your Name to Start Your Order");
            string userName = Console.ReadLine().ToUpper();

            TypeLine("Hello " + userName + "," + " welcome to 'La Boulangerie' bakery!");
            TypeLine("----------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.DarkBlue;
            TypeLine("Please select from our Menu: ");
            TypeLine("Bread: $5each or Buy 2 and get 1 FREE");
            TypeLine("Pastry: $2each or Buy 3 for $5");
            TypeLine("----------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            TypeLine("Would you like to order Bread or Pastry?");
            string userOrder = Console.ReadLine().ToLower();

            if (userOrder == "bread")
            {
                TypeLine("How many loafs of bread would you like?");
                string loafQuont = Console.ReadLine();
                int    loafNum   = int.Parse(loafQuont);
                bread.BreadPrice(loafNum);
                TypeLine($"Bread order summary: Total number of bread(s): {loafNum} Price: $ {bread.LoafPrice}");
            }
            else if (userOrder == "pastry")
            {
                TypeLine("How many of the pasties would you like?");
                string pastryQuont = Console.ReadLine();
                int    pastryNum   = int.Parse(pastryQuont);
                pastry.PastryTotal(pastryNum);
                TypeLine($"Pastry order summary: Total number of pastr(y/ies): {pastryNum} Price: $ {pastry.PastryPrice}");
            }
            else
            {
                TypeLine("Please select an item that is on the menu!");
            }
            System.Threading.Thread.Sleep(3000);
            Main();
        }
Пример #4
0
        public static void Main()
        {
            Console.WriteLine("Welcome to Pierre's Bakery");
            Console.WriteLine("Each loaf of bread is $5 but we have a bread special - buy 2, get 1 free.");
            Console.WriteLine("Each pastry is $2 or get 3 for $5");

            Console.WriteLine("Enter the number of Bread loaves");
            int   inputBread = int.Parse(Console.ReadLine());
            Bread newBread   = new Bread(inputBread);
            int   priceBread = newBread.GetBreadPrice();

            Console.WriteLine("Enter the number of Pastries");
            int    inputPastry = int.Parse(Console.ReadLine());
            Pastry newPastry   = new Pastry(inputPastry);
            int    pricePastry = newPastry.GetPastryPrice();


            Console.WriteLine("Your total is: $ " + (priceBread + pricePastry));
        }
Пример #5
0
        public static void Main()
        {
            Bread  breadToday  = new Bread();
            Pastry pastryToday = new Pastry();

            Console.WriteLine("Welcome to Pierre's Bakery! Today we're offering sourdough bread($" + breadToday.Price + ")" + " and puff pastries($" + pastryToday.Price + ").");
            Console.WriteLine("Specials Today: Buy 2 loaves of bread, get 1 free! Get 3 pastries for just $5!");
            Console.WriteLine("Enter how many loaves of sourdough bread you would like:");
            string breadEntry  = Console.ReadLine();
            int    breadNumber = int.Parse(breadEntry);

            Console.WriteLine("Enter how many puff pastries you would like:");
            string pastryEntry  = Console.ReadLine();
            int    pastryNumber = int.Parse(pastryEntry);

            int totalCost = breadToday.DetermineBreadPrice(breadNumber) + pastryToday.DeterminePastryPrice(pastryNumber);

            Console.WriteLine("Your total today is $" + totalCost + ". Come back soon!");
        }
Пример #6
0
        public static void Main()
        {
            RedBackground(
                @"                      

  _____ _____ ______ _____  _____  ______ _       ____          _  ________ _______     __
 |  __ \_   _|  ____|  __ \|  __ \|  ____( )     |  _ \   /\   | |/ /  ____|  __ \ \   / /
 | |__) || | | |__  | |__) | |__) | |__  |/ ___  | |_) | /  \  | ' /| |__  | |__) \ \_/ / 
 |  ___/ | | |  __| |  _  /|  _  /|  __|   / __| |  _ < / /\ \ |  < |  __| |  _  / \   /  
 | |    _| |_| |____| | \ \| | \ \| |____  \__ \ | |_) / ____ \| . \| |____| | \ \  | |   
 |_|   |_____|______|_|  \_\_|  \_\______| |___/ |____/_/    \_\_|\_\______|_|  \_\ |_|   

                                   
                                                                            
                          We sell bread and pastries
                          Would you like some: 
                                [B]read
                                [P]astries

                                
                                ");

            string resp = Console.ReadLine().ToLower();

            while (resp != "t")
            {
                if (resp == "b")
                {
                    resp = Bread.BreadMenu();
                }

                else
                {
                    resp = Pastry.PastryMenu();
                }
            }

            if (resp == "t")
            {
                TotalPrice();
            }
        }
Пример #7
0
        static void Main()
        {
            Console.WriteLine("Welcome to Pierre's Bakery! Or as we like to say, Bienvenue! We have loaves of bread for $5 each and pastries for $2 each. We are running a Christmas special for the month of December where our loaves of bread are buy 2 get 1 free and our pastries are 3 for $5!");
            Console.WriteLine("Please enter the number of loaves you would like to purchase today: ['0' to skip to pastries]");
            string stringBread = Console.ReadLine();
            int    numBread    = int.Parse(stringBread);

            Console.WriteLine("How many pastries would you like? ['0' to skip to checkout]");                string stringPastries = Console.ReadLine();
            int numPastries = int.Parse(stringPastries);

            Bread  breads   = new Bread(numBread, 5);
            Pastry pastries = new Pastry(numPastries, 2);

            int    breadCost   = breads.CalculateCost();
            int    pastryCost  = pastries.CalculateCost();
            int    total       = (breadCost + pastryCost);
            string stringTotal = total.ToString();

            Console.WriteLine("Your total comes out to: $" + stringTotal);
        }
Пример #8
0
        public void MakeBread(bool glutenFree, bool isSliced, int count)
        {
            Bread bread = new Bread(glutenFree, isSliced);

            Thread.Sleep(500); // baking time
            if (isSliced)
            {
                Thread.Sleep(200 * count); // slice time
            }
            Bread breadInList = MadeBread.Where(breadPair => breadPair.Key.IsSliced == isSliced && breadPair.Key.IsGlutenFree == glutenFree).FirstOrDefault().Key;

            if (breadInList != null)
            {
                MadeBread[breadInList] += count;
            }
            else
            {
                MadeBread.Add(bread, count);
            }
        }
Пример #9
0
        public void RequestProduct()
        {
            string[] productOptions = new string[] { "bread", "pastry", "nevermind" };
            Console.WriteLine("What would you like to order? [Bread, Pastry, Nevermind]");
            string product = Interaction.AskOptionsQuestion(productOptions, "So.. What would you like to order?  [Bread, Pastry, Nevermind]");

            if (product.StartsWith('b'))
            {
                bool[] breadRequest = RequestBread();
                int    breadCount   = IsBreadMade(breadRequest);
                Bread  breadEx      = new Bread(breadRequest[0], breadRequest[1]);
                int    breadInOrder = ExistingOrderCount(breadEx);
                int[]  breadToMake  = ProductQuantity(breadCount, breadInOrder);
                if (breadToMake[0] > 0)
                {
                    Console.WriteLine("");
                    Console.WriteLine("Your bread just went in the oven! Please wait. It's worth it!");
                    MakeBread(breadRequest[0], breadRequest[1], breadToMake[0]);
                }
                AddToOrder(breadEx, breadToMake[1]);
            }
            else if (product.StartsWith('p'))
            {
                string[] pastryRequest = RequestPastry();
                int      pastryCount   = IsPastryMade(Convert.ToBoolean(pastryRequest[0]), pastryRequest[1]);
                Pastry   pastryEx      = new Pastry(Convert.ToBoolean(pastryRequest[0]), pastryRequest[1]);
                int      pastryInOrder = ExistingOrderCount(pastryEx);
                int[]    pastryToMake  = ProductQuantity(pastryCount, pastryInOrder);
                if (pastryToMake[0] > 0)
                {
                    Console.WriteLine("");
                    Console.WriteLine("Your " + (pastryToMake[0] == 1 ? "pastry" : "pastries") + " just went in the oven! Please wait. It's worth it!");
                    MakePastry(Convert.ToBoolean(pastryRequest[0]), pastryRequest[1], pastryToMake[0]);
                }
                AddToOrder(pastryEx, pastryToMake[1]);
            }
            else if (product.StartsWith('n'))
            {
                Console.WriteLine("Ok.");
            }
        }
Пример #10
0
        public static void InputOrder(string input)
        {
            Console.WriteLine($"How much {input} do you need?");
            int quantity = int.Parse(Console.ReadLine());

            if (input == "bread")
            {
                Bread uOrder = new Bread(quantity);
                Console.WriteLine($"Your {uOrder.Order} Loaves of bread will cost ${uOrder.BreadOrder()}");
            }
            else if (input == "pastry")
            {
                Pastry uOrder = new Pastry(quantity);
                Console.WriteLine($"Your {uOrder.Order} Pastries will cost ${uOrder.PastryOrder()}");
            }
            else
            {
                Console.WriteLine("not a valid selection");
                Main();
            }
        }
Пример #11
0
        public static void TakeOrder()
        {
            int loafAmt   = 0;
            int danishAmt = 0;

            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine("Our hostess will now take your order!");
            Console.WriteLine("How many artisanal loaves would you like to purchase?");
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

            string loaf      = Console.ReadLine();
            bool   loafParse = int.TryParse(loaf, out loafAmt);

            Console.WriteLine("How many artisanal danish's would you like to purchase?");

            string danish      = Console.ReadLine();
            bool   danishParse = int.TryParse(danish, out danishAmt);

            if (loafParse && danishParse && loafAmt >= 0 && danishAmt >= 0)
            {
                Bread  customerLoaf   = new Bread(loafAmt);
                Pastry customerDanish = new Pastry(danishAmt);

                Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                Console.ForegroundColor = ConsoleColor.DarkMagenta;
                Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

                Console.WriteLine("Thank you for giving Pierre's Bakery your buisness. Your Total is: $" + (customerDanish.GrabDanish() + customerLoaf.GrabLoaf()));

                Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("Sorry, you can only purchase whole loaves & danishes!");
            }
        }
Пример #12
0
        public static void NewOrder(Bread loaf, Pastery croissant)
        {
            Console.WriteLine("Would you like to purchase bread or a pastery, or view your basket? (bread/pastery/basket)");
            string userInput = Console.ReadLine();

            if (userInput.ToLower() == "view" || userInput.ToLower() == "basket")
            {
                Console.WriteLine("--------------------------------\nYour order:\n" + loaf.Quantity + " bread item(s) and " + croissant.Quantity + " pastery item(s).");
                loaf.CalculatePrice();
                croissant.CalculatePrice();
                Console.WriteLine("Your total is $ " + (loaf.Total + croissant.Total) + ".\n--------------------------------");
                Console.WriteLine("Would you like to exit program? (exit/continue)");
                string userContinue = Console.ReadLine();
                if (userContinue.ToLower() == "continue")
                {
                    NewOrder(loaf, croissant);
                }
            }
            else if (userInput.ToLower() == "bread")
            {
                Console.WriteLine("You have ordered a " + loaf.Name + " of bread.");
                Console.WriteLine("It will cost $" + loaf.Price);
                loaf.AddOne();
                Console.WriteLine("You currently have " + loaf.Quantity + " bread item(s)");
                NewOrder(loaf, croissant);
            }
            else if (userInput.ToLower() == "pastery")
            {
                Console.WriteLine("You have ordered a " + croissant.Name + " of bread.");
                Console.WriteLine("It will cost $" + croissant.Price);
                croissant.AddOne();
                Console.WriteLine("You currently have " + croissant.Quantity + " pastery item(s)");
                NewOrder(loaf, croissant);
            }
            else
            {
                Console.WriteLine("We could not understand your order, please re-enter either 'bread' or 'pastery'.");
                NewOrder(loaf, croissant);
            }
        }
Пример #13
0
        public static void Main()
        {
            Console.WriteLine("Welcome to Pierre's Bakery!");
            Console.WriteLine("Bread is $5. OR buy 2, get 1 free.");
            Console.WriteLine("Pastry is $2. OR buy 3 for $5.");

            Console.WriteLine("How many loaves of Bread do you want? Enter a number please.");
            string stringBread = Console.ReadLine();
            int    BreadNumber = int.Parse(stringBread);

            Console.WriteLine("How many pastries do you want? Enter a number please.");
            string stringPastry = Console.ReadLine();
            int    PastryNumber = int.Parse(stringPastry);

            int breadResponse  = Bread.CalculateBread(5, BreadNumber);
            int pastryResponse = Pastry.CalculatePastry(2, PastryNumber);
            int overallOrder   = OrderPrice.OrderIs(breadResponse, pastryResponse);

            Console.WriteLine("Your order: " + BreadNumber + " loaves for $" + breadResponse + ".");
            Console.WriteLine("Your order: " + PastryNumber + " individual pastries for $" + pastryResponse + ".");
            Console.WriteLine("Your total will be $" + overallOrder + ".");
        }
Пример #14
0
        public static int BreadOrder()
        {
            Bread bread = new Bread("bread", 5);

            Console.WriteLine("How many loaves would you like today?");
            string breadString = Console.ReadLine();

            while (!Int32.TryParse(breadString, out int result))
            {
                Console.WriteLine("Sorry I didn't catch that! Please enter a number of loaves.");
                breadString = Console.ReadLine();
            }
            int breadNumber    = int.Parse(breadString);
            int breadTotalCost = Bakery.BakedGoods.Bread.CalculateBread(breadNumber, bread.Price);

            if (breadNumber >= 3)
            {
                Console.WriteLine("Lucky you! Bread is buy 2 get 1 free today!");
            }

            Console.WriteLine("Your bread total is: $" + breadTotalCost);
            return(breadTotalCost);
        }
Пример #15
0
        static void Main()
        {
            Console.WriteLine("Bonjour! Wecome to Pierre's Bakery. Bread is $5 and Pastries are $2. We also offer special deals!");
            Console.WriteLine("Would you like to order some delicious bread and pastries? If Yes [press 'Y']. Otherwise [press 'Enter'].");
            string response = Console.ReadLine();

            if (response == "Y" || response == "y")
            {
                Console.WriteLine("How many loaves of bread would you like?");
                string loaves     = Console.ReadLine();
                int    loavesInt  = int.Parse(loaves);
                Bread  newBread   = new Bread(loavesInt);
                int    breadPrice = newBread.GetBreadPrice();
                Console.WriteLine("The Price for your bread is: $" + breadPrice + ".");
                Console.WriteLine("How many pastries would you like?");
                string pastries    = Console.ReadLine();
                int    pastryInt   = int.Parse(pastries);
                Pastry newPastry   = new Pastry(pastryInt);
                int    pastryPrice = newPastry.GetPastryPrice();
                Console.WriteLine("The Price for your pastries is $" + pastryPrice + ".");
                Console.WriteLine("Your grand total today is $" + (breadPrice + pastryPrice) + ". Bon appetit!");
                Console.WriteLine("Would you like to place another order? If Yes [press 'Y']. Otherwise [press 'Enter'].");
                string response2 = Console.ReadLine();
                if (response2 == "Y" || response2 == "y")
                {
                    Main();
                }
                else
                {
                    Console.WriteLine("Au revior!");
                }
            }
            else
            {
                Main();
            }
        }
Пример #16
0
        public static void Bakery()
        {
            Console.WriteLine("\nBAKERY PRODUCTS:");
            Console.WriteLine("Bread: $5 per piece (Buy 2 get 1 free!).");
            Console.WriteLine("Pastry: $2 per pastry (Buy 1 for $2 or 3 for $5).");
            Console.WriteLine("Donut: $4 per Donut. (1 free Donut for every 2 pieces of bread!");
            Console.WriteLine("\n\nEnter the amount of Bread and Pastries you would like in the following format (Bread Quanity, Pastry Quantity, Donut Quantity) EX.(5,9,2).\n");

            string userInput = Console.ReadLine();

            string[] cart = userInput.Split(",");
            try {
                int amountOfBread  = int.Parse(cart[0]);
                int amountOfPastry = int.Parse(cart[1]);
                int amountOfDonut  = int.Parse(cart[2]);

                Bread bread = new Bread(amountOfBread);
                Console.WriteLine("\n$" + bread.BreadTotal + " is the total for the Bread");

                Pastry pastry = new Pastry(amountOfPastry);
                Console.WriteLine("$" + pastry.PastryTotal + " is the total for the Pastries");

                Donut donut = new Donut(amountOfDonut, bread);
                Console.WriteLine("$" + donut.DonutTotal + " is the total for the Donuts");

                int totalTotal = bread.BreadTotal + donut.DonutTotal;

                Console.WriteLine("\nYour total for today will be $" + totalTotal + "\n");
            } catch (Exception error)     //Exception is a data type for error handling and error is the name used if you wanna print it or something (Note to self)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\nINVALID FORMAT, PLEASE USE NUMBERS AND CREATE YOU ORDER IN THE EXAMPLE FORMAT: EX.5,5\n");
                Console.ResetColor();
                Thread.Sleep(3000);
                Bakery();
            }
        }
Пример #17
0
        public static void Main()
        {
            Bread  breadStock  = new Bread(30, 5);
            Pastry PastryStock = new Pastry(30, 2, 5);

            Console.WriteLine("Menu:\n Bread: $" + Bread.Price + "\n Pastries: $" + Pastry.Price);
            Console.WriteLine("\nEnter Order:");
            Console.WriteLine("\nHow many loaves of bread would you like?");
            string breadOrder = Console.ReadLine();
            bool   isBreadInt = int.TryParse(breadOrder, out int numBread);

            Console.WriteLine("How many pastries would you like?");
            string pastryOrder = Console.ReadLine();
            bool   isPastryInt = int.TryParse(pastryOrder, out int numPastry);

            if (!isBreadInt || !isPastryInt)
            {
                Console.WriteLine("\nPlease enter a number\n");
                Thread.Sleep(1000);
                Main();
                return;
            }

            if (numBread >= 1 && isBreadInt)
            {
                Console.WriteLine("Your order comes to,\n   Bread: $" + Bread.buyLoaves(numBread));
            }
            if (numPastry >= 1 && isPastryInt)
            {
                Console.WriteLine("   Pastry: $" + Pastry.buyPastry(numPastry));
            }
            Console.WriteLine(Total(Bread.OrderPrice, Pastry.OrderPrice));
            Console.WriteLine("\nPress any key to exit");
            Console.ReadKey();
            return;
        }
Пример #18
0
        public static void PrintCart()
        {
            Console.WriteLine("\n----------------------");
            Console.WriteLine("   [Shpping Cart:] ");
            Console.WriteLine("----------------------");
            List <Bread>  breadCart  = ShoppingCart.GetBread();
            List <Pastry> pastryCart = ShoppingCart.GetPastry();

            if (breadCart.Count == 0 && pastryCart.Count == 0)
            {
                Console.WriteLine(" *(Empty)");
            }
            else
            {
                foreach (Bread bread in breadCart)
                {
                    Console.WriteLine($" *({bread.Description})");
                }
                int breadQuantity = ShoppingCart.GetBread().Count;
                int breadSubTotal = Bread.GetPrice(breadQuantity);
                Console.WriteLine($" [Bread subtotal: ${breadSubTotal.ToString()}]\n");
                foreach (Pastry pastry in pastryCart)
                {
                    Console.WriteLine($" *({pastry.Description})");
                }
                int pastryQuantity = ShoppingCart.GetPastry().Count;
                int pastrySubTotal = Pastry.GetPrice(pastryQuantity);
                Console.WriteLine($" [Pastry subtotal: ${pastrySubTotal.ToString()}]");
            }
            string grandTotal = ShoppingCart.GetTotal().ToString();

            Console.WriteLine("----------------------");
            Console.WriteLine($"  [Grand Total: ${grandTotal}]");
            Console.WriteLine("----------------------");
            Console.WriteLine("\n(Type 'm' to see the menu, 'c' to clear the cart, and 'd' when done.)");
        }
Пример #19
0
        static void Main()
        {
            Console.WriteLine("Welcome. The cost for bread is as follows:");
            Console.WriteLine("For 1 loaf, it's $5. If you buy 2, then you get the 3rd for free.");
            Console.WriteLine("For pastries you can buy 1 for $2, or 3 for $5.");
            Console.WriteLine("How many loaves of bread would you like?");
            string breadCountString = Console.ReadLine();

            Console.WriteLine("How many pastries would you like?");
            string pastryCountString = Console.ReadLine();

            int breadCount  = int.Parse(breadCountString);
            int pastryCount = int.Parse(pastryCountString);

            Pastry newPastry  = new Pastry("yummy");
            int    pastryCost = newPastry.PastryOrderCalc(pastryCount);

            Bread newBread  = new Bread("yummy");
            int   breadCost = newBread.BreadOrderCalc(breadCount);

            int orderTotal = pastryCost + breadCost;

            Console.WriteLine("This is your total order cost: " + orderTotal);
        }
Пример #20
0
        public static void Main()
        {
            Console.WriteLine("-----------------------------------");
            Console.WriteLine("Welcome to Pierre's Bakery! We have loaves of bread for 5 dollars and pastries for 2 dollars.");
            Console.WriteLine("Our deals today are buy two loaves get one free, and 5 dollars for 3 pastries.");
            Console.WriteLine("------------------------------------");
            Console.WriteLine("How many loaves of bread would you like to order?");
            int BreadInput = int.Parse(Console.ReadLine());

            Console.WriteLine("------------------------------------");
            Console.WriteLine("How many pastries would you like to order?");
            int PastryInput = int.Parse(Console.ReadLine());

            Console.WriteLine("------------------------------------");
            Bread  newBread  = new Bread(BreadInput, 0);
            Pastry newPastry = new Pastry(PastryInput, 0);

            newBread.BreadDeal(BreadInput);
            newPastry.PastryDeal(PastryInput);
            int Checkout = newPastry.PastryTotal + newBread.BreadTotal;

            Console.WriteLine("Your total is: $" + Checkout);
            Console.WriteLine("------------------------------------");
        }
Пример #21
0
        public static void Main(string[] args)
        {
            List <Bread> BreadOrder   = new List <Bread> {
            };
            List <Pastry> PastryOrder = new List <Pastry> {
            };
            bool OrderComplete        = false;

            Console.WriteLine("Welcome to Pierre's Bakery!");
            Console.WriteLine("Press the enter key to begin an order!");
            Console.ReadLine();
            while (OrderComplete == false)
            {
                Console.Clear();
                Console.WriteLine("Please enter below whether you'd like to purchase a bread or pastry:");
                string OrderType = (Console.ReadLine()).ToLower();
                if (OrderType == "bread")
                {
                    Console.WriteLine("How much bread would you like add to your purchase? Please only enter a number.");
                    string Quantity = Console.ReadLine();
                    if (Int32.Parse(Quantity) >= 0)
                    {
                        Console.WriteLine("Great your order has been updated!");
                    }
                    else
                    {
                        Console.WriteLine("I'm sorry, you must enter a number");
                        Quantity = Console.ReadLine();
                    }
                    Bread NewBreadOrder = new Bread(Int32.Parse(Quantity));
                    BreadOrder.Add(NewBreadOrder);
                    Console.WriteLine("Would you like to add another Item to your order? Reply 'yes' or 'no'.");
                    string Answer = Console.ReadLine();
                    if (Answer.ToLower() == "yes")
                    {
                        OrderComplete = false;
                    }
                    else if (Answer.ToLower() == "no")
                    {
                        OrderComplete = true;
                    }
                }
                else if (OrderType == "pastry")
                {
                    Console.WriteLine("How much Pastry would you like add to your purchase? Please only enter a number.");
                    string Quantity = Console.ReadLine();
                    if (Int32.Parse(Quantity) >= 0)
                    {
                        Console.WriteLine("Great your order has been updated!");
                    }
                    else
                    {
                        Console.WriteLine("I'm sorry, you must enter a number");
                        Quantity = Console.ReadLine();
                    }
                    Pastry NewPastryOrder = new Pastry(Int32.Parse(Quantity));
                    PastryOrder.Add(NewPastryOrder);
                    Console.WriteLine("Would you like to add another Item to your order? Reply 'yes' or 'no'.");
                    string Answer = Console.ReadLine();
                    if (Answer.ToLower() == "yes")
                    {
                        OrderComplete = false;
                    }
                    else if (Answer.ToLower() == "no")
                    {
                        OrderComplete = true;
                    }
                }
                else
                {
                    Console.WriteLine("I'm sorry we don't have that here, press the enter key to return to the previous question");
                    Console.ReadLine();
                };
            }
            ;
            if (BreadOrder.Count > 0 && PastryOrder.Count > 0)
            {
                int OrderTotal = 0;
                // BreadOrder[0].AddSalesPromo() + PastryOrder[0].AddSalesPromo();
                foreach (Bread item in BreadOrder)
                {
                    OrderTotal += item.AddSalesPromo();
                }
                foreach (Pastry item in PastryOrder)
                {
                    OrderTotal += item.AddSalesPromo();
                }
                Console.WriteLine($"Your order total is: ${OrderTotal}");
            }
            else if (BreadOrder.Count > 0)
            {
                int OrderTotal = 0;
                // BreadOrder[0].AddSalesPromo();
                foreach (Bread item in BreadOrder)
                {
                    OrderTotal += item.AddSalesPromo();
                }
                Console.WriteLine($"Your order total is: ${OrderTotal}");
            }
            else if (PastryOrder.Count > 0)
            {
                int OrderTotal = 0;
                // PastryOrder[0].AddSalesPromo();
                foreach (Pastry item in PastryOrder)
                {
                    OrderTotal += item.AddSalesPromo();
                }
                Console.WriteLine($"Your order total is: ${OrderTotal}");
            }
            ;
        }
Пример #22
0
        public static void Main()
        {
            Console.WriteLine(@"Hello! Welcome to Pierre's Bakery. We have a few choice items for sale:
Bread  $5   Sale: buy 2 get 1 free!
Pastry $2   Sale: buy 3 for $5", Color.Pink);

            //Collect data from user and get prices for entered values
            Console.WriteLine("How much bread would you like to purchase?");
            string bString = Console.ReadLine();

            if (!float.TryParse(bString, out float bFloat))
            {
                bFloat = 0;
            }
            Bread bread = new Bread(bFloat);

            Console.WriteLine("How many pastries would you like?");
            string pString = Console.ReadLine();

            if (!float.TryParse(pString, out float pFloat))
            {
                pFloat = 0;
            }
            Pastry pastry = new Pastry(pFloat);

            //Convert prices into various floats for display purposes in a console receipt
            float subTotal = bread.bPrice() + pastry.pPrice();
            float saleTax = subTotal * 0.07f, saleTotal = saleTax + subTotal, tip = saleTotal;

            tip = (float)System.Math.Round(saleTotal * .2f, 2);

            //Instantiate Dictionary object with strings and numbers to display
            Dictionary <string, float> receipt = new Dictionary <string, float>()
            {
                { "Pierre's Bakery", 0 },
                { "Candy Lane", 0 },
                { "Seattle Washington", 0 },
                { "1-800-BAKE", 0 },
                { "Bread", bread.bPrice() },
                { "Pastry", pastry.pPrice() },
                { "Subtotal", subTotal },
                { "Tax", saleTax },
                { "Total", saleTotal },
                { "Tip", tip },
                { "Item Count", (bFloat + pFloat) },
                { "THANK YOU", 0 }
            };

            //Loop through Dictionary object and print out elements
            Console.WriteLine("+-------------------------------------+");
            for (int i = 0; i < receipt.Count; i++)
            {
                if (receipt[receipt.Keys.ElementAt(i)] == 0)
                {
                    string a = String.Format("|{0,25}             |", receipt.Keys.ElementAt(i));
                    Console.WriteLine(a);
                }
                else
                {
                    string a = String.Format("|{0,-10}{1,28:C2}|", receipt.Keys.ElementAt(i), receipt[receipt.Keys.ElementAt(i)]);
                    Console.WriteLine(a);
                }
            }
            Console.WriteLine("+-------------------------------------+");
        }
Пример #23
0
        public static void Main()
        {
            Bread  baguette         = new Bread("Baguette", 5, 1);
            Bread  specialBaguette  = new Bread("Baguette", 15, 3);
            Pastry croissant        = new Pastry("Croissant", 2, 1);
            Pastry specialCroissant = new Pastry("Croissant", 6, 3);

            Console.WriteLine("----------------------------------");
            Console.WriteLine("HELLO WELCOME TO PIERRE'S BAKERY!");
            Console.WriteLine("----------------------------------");
            Console.WriteLine("Do you want to see my menu?");
            string menu = Console.ReadLine();

            if (menu == "yes" || menu == "Yes")
            {
                Console.WriteLine("----------------------");
                Console.WriteLine(baguette.Kind + " $" + baguette.Price);
                Console.WriteLine(croissant.Kind + " $" + croissant.Price);
            }

            Console.WriteLine("----------------------");
            Console.WriteLine("Would you like to see our specials?");
            string specials = Console.ReadLine();

            if (specials == "yes" || specials == "Yes")
            {
                Console.WriteLine("----------------------");
                Console.WriteLine("ANY kind of Bread Buy 2 and get 1 free!");
                Console.WriteLine("ANY kind of Pastry Buy 3 for $5");
                Console.WriteLine("----------------------");
            }
            else
            {
                Console.WriteLine("Well let's make an order!");
            }

            Console.WriteLine("Are you ready to Order?");
            string order = Console.ReadLine();

            if (order == "yes" || order == "Yes")
            {
                Console.WriteLine("----------------------");
                Console.WriteLine("LAZY MODE");
                Console.WriteLine("Please Enter:");
                Console.WriteLine("1 for single Bread");
                Console.WriteLine("2 for single Pastry");
                Console.WriteLine("3 for Bread special");
                Console.WriteLine("4 for Pastry special");
                Console.WriteLine("----------------------");
                string number = Console.ReadLine();
                if (number == "1")
                {
                    Console.WriteLine("Your total price for " + baguette.Quantity + " " + baguette.Kind + " is $" + baguette.Price);
                    Console.WriteLine("Thank you for your Purchase!");
                }
                else if (number == "2")
                {
                    Console.WriteLine("Your total price for " + croissant.Quantity + " " + croissant.Kind + " is $" + croissant.Price);
                    Console.WriteLine("Thank you for your Purchase!");
                }
                else if (number == "3")
                {
                    Console.WriteLine("Your total price for " + specialBaguette.Quantity + " " + specialBaguette.Kind + " is $" + specialBaguette.GetDiscount(3));
                    Console.WriteLine("Thank you for your Purchase!");
                }
                else if (number == "4")
                {
                    Console.WriteLine("Your total price for " + specialCroissant.Quantity + " " + specialCroissant.Kind + " is $" + specialCroissant.GetDiscount(3));
                    Console.WriteLine("Thank you for your Purchase!");
                }
            }
            else
            {
                Console.WriteLine("Thank you for your Visit! Bye!");
            }
        }
Пример #24
0
        public static void TotalPrice()
        {
            string receiptHead;

            receiptHead = (
                $@"              

                       ____________________________________________________________
                      |        ################
                      |        ###Items List###
                      |        ################
                      |    ");
            Console.WriteLine(receiptHead);
            // int breadTypeCount = 0;
            // decimal breadTotal = 0m;
            // int pastryTypeCount = 0;
            // decimal pastryTotal = 0m;
            //int pastryTypeCount = 0;

            decimal       breadDiscount  = Bread.CalculateBreadDiscount();
            decimal       breadPrice     = Bread.TotalBreadPrice();
            decimal       newBreadTotal  = breadPrice - breadDiscount;
            List <string> breadReceipt   = Bread.GenerateBreadReceipt();
            decimal       pastryDiscount = Pastry.CalculatePastryDiscount();
            decimal       pastryPrice    = Pastry.TotalPastryPrice();
            decimal       newPastryPrice = pastryPrice - pastryDiscount;
            List <string> pastryReceipt  = Pastry.GeneratePastryReceipt();
            List <string> receipt        = new List <string> {
            };

            receipt.Add(receiptHead);


            decimal totalPricetag = newPastryPrice + newBreadTotal;

            foreach (string b in breadReceipt)
            {
                Console.WriteLine(b);
                receipt.Add(b);
            }

            foreach (string p in pastryReceipt)
            {
                Console.WriteLine(p);
                receipt.Add(p);
            }
            string priceString = (
                $@"                      |                                                                                                                                
                      |  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++   
                      |                                                                                                                            
                      |   Your total bread price before discounts is: ${breadPrice}          
                      |   Your total bread price after discounts is: ${newBreadTotal}           
                      |   Your total pastry price before discounts is: ${pastryPrice}          
                      |   Your total pastry price after discount is: ${newPastryPrice}            
                      |   --                                                          
                      |   Your total price is: ${totalPricetag}                                
                      |   --                                                          
                      |   You saved ${breadDiscount} on bread!                                   
                      |   You saved ${pastryDiscount} on pastries!                                 
                       ---------------------------------------------------------------");

            Console.WriteLine(priceString);

            receipt.Add(priceString);

            Console.WriteLine($"Would you like to save this receipt? [y/n]");
            if (Console.ReadLine().ToLower() == "y")
            {
                PrintReceipt(receipt);
            }
            else
            {
                Console.ReadLine();
                Console.ResetColor();
            }
        }
Пример #25
0
        static void Main()
        {
            Console.Clear();
            Console.WriteLine(@"
===================================================================
  _____ _                    _       ____        _                   
 |  __ (_)                  ( )     |  _ \      | |                  
 | |__) |  ___ _ __ _ __ ___|/ ___  | |_) | __ _| | _____ _ __ _   _ 
 |  ___/ |/ _ \ '__| '__/ _ \ / __| |  _ < / _` | |/ / _ \ '__| | | |
 | |   | |  __/ |  | | |  __/ \__ \ | |_) | (_| |   <  __/ |  | |_| |
 |_|   |_|\___|_|  |_|  \___| |___/ |____/ \__,_|_|\_\___|_|   \__, |
                                                                __/ |
                                                               |___/ 
======================================================================
            ", Color.BlueViolet);

            Console.WriteLine(@"---------------------  [MAIN MENU] -----------------------");
            Console.WriteLine(@"        Bread $5: Buy 2, get 1 free.");
            Console.WriteLine(@"        Pastry $2: Buy 3 for $5.");

            StyleSheet styleSheet = new StyleSheet(Color.Green);

            styleSheet.AddStyle("B[A-Z]*", Color.Red);
            styleSheet.AddStyle("P[A-Z]*", Color.Cyan);
            styleSheet.AddStyle("C[A-Z]*", Color.Yellow);
            styleSheet.AddStyle("Q[A-Z]*", Color.White);

            //Menu string
            string Menu = (@"
        | [B] for bread menu         | 
        | [P] for pastry menu        | 
        | [C] to view your cart      |
        | [Q] to quit                |
        ");

            //print Menu
            Console.WriteStyled(Menu, styleSheet);
            Console.WriteLine();
            Console.Write("        Enter : ", Color.Green);
            string input = Console.ReadLine().ToLower();

            switch (input)
            {
            case "b":
                Bread.Menu();
                Main();
                break;

            case "p":
                Pastry.Menu();
                Main();
                break;

            case "c":
                Cart.Menu();
                Main();
                break;

            case "q":
                break;

            default:
                TryAgain();
                Main();
                break;
            }
        }
Пример #26
0
        public static void Main()
        {
            Bread  newBread  = new Bread("", 0, 0, 0);
            Pastry newPastry = new Pastry("", 0, 0, 0, 0);

            Bread french       = new Bread("French Bread", 1, 0, 8);
            Bread white        = new Bread("White Bread", 2, 0, 5);
            Bread rye          = new Bread("Rye Bread", 3, 0, 6);
            Bread pumpernickel = new Bread("Pumpernickel", 4, 0, 4);

            Pastry cruller   = new Pastry("Cruller", 1, 0, 3, 7);
            Pastry croissant = new Pastry("Croissant", 2, 0, 1, 2);
            Pastry cinnamon  = new Pastry("Cinnamon Bun", 3, 0, 5, 11);
            Pastry donut     = new Pastry("Plain Donut", 4, 0, 2, 5);

            List <Bread> breadShelf = new List <Bread>(4)
            {
                french, white, rye, pumpernickel
            };

            List <Pastry> pastryShelf = new List <Pastry>(4)
            {
                cruller, croissant, cinnamon, donut
            };

            Console.BackgroundColor = ConsoleColor.Red;
            Console.ForegroundColor = ConsoleColor.Black;

            Console.WriteLine(Figgle.FiggleFonts.Crawford.Render("CarbQuest"));

            Console.WriteLine("Welcome to Pierre's Bakery! We have a 'Buy 2 and get 1 free' sale on bread, 'discount on 3' sale on pastries. Press y to see our shelves, any other key to exit.");

            string response1 = Console.ReadLine();

            if (response1 == "y" || response1 == "Y")
            {
                foreach (Bread item in breadShelf)
                {
                    Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                    Console.WriteLine(item.BNumber + "  " + item.BName + " --- $" + item.BPrice + " per loaf");
                }

                Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

                Console.WriteLine("Which kind of bread would you like? Enter the number next to the name.");

                string stringBreadPick = Console.ReadLine();
                int    breadPick       = int.Parse(stringBreadPick);

                if (breadPick >= 1 && breadPick <= 4)
                {
                    foreach (Bread item in breadShelf)
                    {
                        if (breadPick == item.BNumber)
                        {
                            newBread.BName   = item.BName;
                            newBread.BNumber = item.BNumber;
                            newBread.BPrice  = item.BPrice;
                        }
                    }

                    Console.WriteLine("How many loaves of " + newBread.BName + " would you like?");
                    string stringBread = Console.ReadLine();
                    newBread.BAmount = int.Parse(stringBread);

                    Console.WriteLine("Total Bread Price: $" + newBread.BreadDiscounter() + ". Press y to continue to the pastry shelves, or any other key to check out.");

                    string response2 = Console.ReadLine();
                    if (response2 == "y" || response2 == "Y")
                    {
                        foreach (Pastry item in pastryShelf)
                        {
                            Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
                            Console.WriteLine(item.PNumber + "  " + item.PName + " --- $" + item.PPrice1 + " per pastry, $" + item.PPrice2 + " for three");
                        }

                        Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

                        Console.WriteLine("Which kind of Pastry would you like? Enter the number next to the name.");

                        string stringpastryPick = Console.ReadLine();
                        int    pastryPick       = int.Parse(stringpastryPick);

                        if (pastryPick >= 1 && pastryPick <= 4)
                        {
                            foreach (Pastry item in pastryShelf)
                            {
                                if (pastryPick == item.PNumber)
                                {
                                    newPastry.PName   = item.PName;
                                    newPastry.PNumber = item.PNumber;
                                    newPastry.PPrice1 = item.PPrice1;
                                    newPastry.PPrice2 = item.PPrice2;
                                }
                            }

                            Console.WriteLine("How many " + newPastry.PName + "s would you like?");
                            string stringPastry = Console.ReadLine();
                            newPastry.PAmount = int.Parse(stringPastry);
                        }
                        else
                        {
                            Console.WriteLine("no pastry for u /)_o(\\");
                        }

                        Console.WriteLine("Total Pastry Price: $" + newPastry.PastryDiscounter());
                    }
                    else
                    {
                        Console.WriteLine(":(");
                    }

                    Console.WriteLine("Your total order price comes to $" + (newBread.BreadDiscounter() + newPastry.PastryDiscounter()) + ".");
                }
                else
                {
                    Console.WriteLine(">:( lame");
                }
            }
        }
Пример #27
0
 public static void AddBread(Bread Bread)
 {
     _breadCart.Add(Bread);
 }
Пример #28
0
        public static bool UserInput(string userInput)
        {
            string[] inputSplit = userInput.Split(' ');
            switch (inputSplit[0])
            {
            case ("1"):
                Bread sourDough = new Bread("Sour Dough Loaf");
                if (inputSplit.Length > 1)
                {
                    AddMultipleBread(inputSplit[1], sourDough);
                }
                else
                {
                    ShoppingCart.AddBread(sourDough);
                    Console.WriteLine("\n*** Sour dough Loaf added! ***");
                }
                return(true);

            case ("2"):
                Bread wheat = new Bread("Wheat Loaf");
                if (inputSplit.Length > 1)
                {
                    AddMultipleBread(inputSplit[1], wheat);
                }
                else
                {
                    ShoppingCart.AddBread(wheat);
                    Console.WriteLine("\n*** Wheat Loaf added! ***");
                }
                return(true);

            case ("3"):
                Bread rye = new Bread("Rye Loaf");
                if (inputSplit.Length > 1)
                {
                    AddMultipleBread(inputSplit[1], rye);
                }
                else
                {
                    ShoppingCart.AddBread(rye);
                    Console.WriteLine("\n*** Rye Loaf added! ***");
                }
                return(true);

            case ("4"):
                Pastry scone = new Pastry("Scone Pastry");
                if (inputSplit.Length > 1)
                {
                    AddMultiplePastry(inputSplit[1], scone);
                }
                else
                {
                    ShoppingCart.AddPastry(scone);
                    Console.WriteLine("\n*** Scone Pastry added! ***");
                }
                return(true);

            case ("5"):
                Pastry muffin = new Pastry("Muffin Pastry");
                if (inputSplit.Length > 1)
                {
                    AddMultiplePastry(inputSplit[1], muffin);
                }
                else
                {
                    ShoppingCart.AddPastry(muffin);
                    Console.WriteLine("\n*** Muffin Pastry added! ***");
                }
                return(true);

            case ("6"):
                Pastry croissant = new Pastry("Croissant Pastry");
                if (inputSplit.Length > 1)
                {
                    AddMultiplePastry(inputSplit[1], croissant);
                }
                else
                {
                    ShoppingCart.AddPastry(croissant);
                    Console.WriteLine("\n*** Croissant Pastry added! ***");
                }
                return(true);

            case ("c"):
                Console.WriteLine("\n*** Cart cleared! ***");
                ShoppingCart.ClearAll();
                return(true);

            case ("m"):
                PrintMenu();
                return(true);

            case ("d"):
                Console.WriteLine("\n*** Proceeding to Checkout ***");
                return(false);

            case ("s"):
                PrintCart();
                return(true);

            default:
                Console.WriteLine("\n*** Sorry please try again...type the NUMBER of the item you want. Type 'm' to see the menu. ***");
                return(true);
            }
        }
Пример #29
0
        public static void Main()
        {
            Console.BackgroundColor = ConsoleColor.Gray;
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.Clear();
            var arr = new[]
            {
                @" _    _      _                          ",
                @"| |  | |    | |                         ",
                @"| |  | | ___| | ___ ___  _ __ ___   ___ ",
                @"| |/\| |/ _ \ |/ __/ _ \| '_ ` _ \ / _ \",
                @"\  /\  /  __/ | (_| (_) | | | | | |  __/",
                @" \/  \/ \___|_|\___\___/|_| |_| |_|\___|",
            };

            Console.WriteLine("\n\n");
            foreach (string line in arr)
            {
                Console.WriteLine(line);
            }
            Console.WriteLine("...to Pierre's Bakery. Today, we have fresh sourdough loaves for $5 (Buy 2, get 1 free) and our cookie of the day for $2 or 3 for $5. Would you like to buy anything? Y/N");
            string PurchaseYN = Console.ReadLine();

            if (PurchaseYN == "Y" || PurchaseYN == "y")
            {
                Console.WriteLine("How many loaves of sourdough would you like?");
                int breadQuant = int.Parse(Console.ReadLine());
                Console.WriteLine("How many cookies would you like?");
                int    cookieQuant = int.Parse(Console.ReadLine());
                int    cookieTotal = 0;
                int    breadTotal  = 0;
                Cookie cookie      = new Cookie(cookieQuant, cookieTotal);
                Bread  bread       = new Bread(breadQuant, breadTotal);
                int    total       = (Cookie.CookieCost(cookieQuant, cookieTotal)) + (Bread.BreadCost(breadQuant, breadTotal));
                Console.WriteLine("Your total is $" + total + ". Would you like anything else? Y/N");
                string PurchaseMoreYN = Console.ReadLine();
                if (PurchaseMoreYN == "Y" || PurchaseMoreYN == "y")
                {
                    Console.WriteLine("How many more loaves would you like?");
                    int newBreadQuant = int.Parse(Console.ReadLine());
                    Console.WriteLine("How many more cookies would you like?");
                    int newCookieQuant   = int.Parse(Console.ReadLine());
                    int finalBreadQuant  = newBreadQuant + breadQuant;
                    int finalCookieQuant = newCookieQuant + cookieQuant;
                    int newTotal         = (Cookie.CookieCost(finalCookieQuant, cookieTotal)) + (Bread.BreadCost(finalBreadQuant, breadTotal));
                    Console.WriteLine("Your new total is $" + newTotal + ".");

                    var arr3 = new[]
                    {
                        @"      _______ _                 _           __                 _                    _               _           _ ",
                        @"     |__   __| |               | |         / _|               | |                  (_)             | |         | |",
                        @"        | |  | |__   __ _ _ __ | | _____  | |_ ___  _ __   ___| |_ ___  _ __  _ __  _ _ __   __ _  | |__  _   _| |",
                        @"        | |  | '_ \ / _` | '_ \| |/ / __| |  _/ _ \| '__| / __| __/ _ \| '_ \| '_ \| | '_ \ / _` | | '_ \| | | | |",
                        @"        | |  | | | | (_| | | | |   <\__ \ | || (_) | |    \__ \ || (_) | |_) | |_) | | | | | (_| | | |_) | |_| |_|",
                        @"        |_|  |_| |_|\__,_|_| |_|_|\_\___/ |_| \___/|_|    |___/\__\___/| .__/| .__/|_|_| |_|\__, | |_.__/ \__, (_)",
                        @"                                                                       | |   | |             __/ |         __/ |  ",
                        @"                                                                       |_|   |_|            |___/         |___/   ",
                    };
                    Console.WriteLine("\n\n");
                    foreach (string line in arr3)
                    {
                        Console.WriteLine(line);
                    }
                }
                else
                {
                    Console.BackgroundColor = ConsoleColor.DarkGray;
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.Clear();
                    Console.WriteLine("Ok, great. Your total is $" + total + ".");
                    var arr3 = new[]
                    {
                        @"      _______ _                 _           __                 _                    _               _           _ ",
                        @"     |__   __| |               | |         / _|               | |                  (_)             | |         | |",
                        @"        | |  | |__   __ _ _ __ | | _____  | |_ ___  _ __   ___| |_ ___  _ __  _ __  _ _ __   __ _  | |__  _   _| |",
                        @"        | |  | '_ \ / _` | '_ \| |/ / __| |  _/ _ \| '__| / __| __/ _ \| '_ \| '_ \| | '_ \ / _` | | '_ \| | | | |",
                        @"        | |  | | | | (_| | | | |   <\__ \ | || (_) | |    \__ \ || (_) | |_) | |_) | | | | | (_| | | |_) | |_| |_|",
                        @"        |_|  |_| |_|\__,_|_| |_|_|\_\___/ |_| \___/|_|    |___/\__\___/| .__/| .__/|_|_| |_|\__, | |_.__/ \__, (_)",
                        @"                                                                       | |   | |             __/ |         __/ |  ",
                        @"                                                                       |_|   |_|            |___/         |___/   ",
                    };
                    Console.WriteLine("\n\n");
                    foreach (string line in arr3)
                    {
                        Console.WriteLine(line);
                    }
                }
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.DarkGray;
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Clear();
                Console.WriteLine("No problem. Thanks for stopping by. I hope you have a great rest of your day!");
                var arr2 = new[]
                {
                    @"       _____                 _ _                _ ",
                    @"      / ____|               | | |              | |",
                    @"     | |  __  ___   ___   __| | |__  _   _  ___| |",
                    @"     | | |_ |/ _ \ / _ \ / _` | '_ \| | | |/ _ \ |",
                    @"     | |__| | (_) | (_) | (_| | |_) | |_| |  __/_|",
                    @"      \_____|\___/ \___/ \__,_|_.__/ \__, |\___(_)",
                    @"                                      __/ |       ",
                    @"                                     |___/        ",
                };
                Console.WriteLine("\n\n");
                foreach (string line in arr2)
                {
                    Console.WriteLine(line);
                }
            }
        }
Пример #30
0
        public static bool Menu(Bread breadOrder, Pastry pastryOrder)
        {
            Console.Clear();
            Console.WriteLine(@"  
      Enter 'B' for standard loaves, 'R' for rye, 'P' for pastry
       Build your order as you go! Or 'C' to checkout
          Made a mistake? Enter 'Q' to start over
          ");
            Console.WriteLine($"    Current order: Standard Loaves - {breadOrder.BreadQuantity}  Rye Loaves - {breadOrder.RyeQuantity}  Pastries - {pastryOrder.PastryQuantity}");
            Console.WriteLine("");
            string userResponseInput = Console.ReadLine();
            string response          = userResponseInput.ToLower();

            if (response == "b")
            {
                Console.Write("Enter the number of loaves: ");
                string breadCountString = Console.ReadLine();
                if (NumberCheck(breadCountString))
                {
                    breadOrder.SetBreadQuantity(int.Parse(breadCountString));
                }
                return(false);
            }
            else if (response == "r")
            {
                Console.Write("Enter the number of rye loaves: ");
                string ryeCountString = Console.ReadLine();
                if (NumberCheck(ryeCountString))
                {
                    breadOrder.SetRyeQuantity(int.Parse(ryeCountString));
                }
                return(false);
            }
            else if (response == "p")
            {
                Console.Write("Enter the number of pastries: ");
                string pastryCountString = Console.ReadLine();
                if (NumberCheck(pastryCountString))
                {
                    pastryOrder.SetPastryQuantity(int.Parse(pastryCountString));
                }
                return(false);
            }
            else if (response == "q")
            {
                breadOrder.ClearBreadOrder();
                pastryOrder.ClearPastryOrder();
            }
            else if (response == "c")
            {
                breadOrder.SetBreadPrice();
                int breadQuantity  = breadOrder.BreadQuantity;
                int ryeQuantity    = breadOrder.RyeQuantity;
                int pastryQuantity = pastryOrder.PastryQuantity;
                int breadTotal     = breadOrder.BreadPriceTotal();
                int pastryTotal    = pastryOrder.PastryPriceTotal();

                Console.WriteLine($@"
              Your total order comes to:
                Loaves: {breadQuantity} standard and {ryeQuantity} rye for ${breadTotal}
                Pastries: {pastryQuantity} for ${pastryTotal}
                Total comes to: ${breadTotal + pastryTotal}
                ");
                return(true);
            }
            return(false);
        }