コード例 #1
0
 public void PastryQty(int quantity)
 {
     for (int i = 0; i < quantity; i++)
     {
         Pastry pastry = new Pastry();
     }
 }
コード例 #2
0
        public static string PastryMenu()
        {
            string pastryType;
            string menuOption = "p";

            Console.Write(
                @"                  
                  
                        Select kind of pastry you'd like:
                       ------------------------------------                       
                                [C]roissant - $2.00
                                [M]uffin - $2.50
                                C[O]okie - $1.50
                       ------------------------------------         
                        (*Croissants are 1 for $2, 3 for $5
                          Must add 3 to your cart to get the deal
                          All deals are applied on checkout)
                                
                                        ");



            pastryType = Console.ReadLine().ToLower();

            Pastry.PastryPrice(pastryType);

            Console.Write(
                @"                            Please enter quantity:

                                
                                ");
            int amount = int.Parse(Console.ReadLine());

            Pastry tempBread = new Pastry(pastryType, amount);
            string tempName  = tempBread.PastryName(pastryType);

            Console.WriteLine(
                $@"                         
                          {amount} {tempName}s added to your cart.");
            Console.Write(
                @"                         
                          If you'd like to see our bread menu, press [B].
                          If you'd like to checkout, press [T]otal.
                          If you'd like to buy more pastries, press enter.


                                ");
            string selection = Console.ReadLine().ToLower();

            if (selection == "b")
            {
                menuOption = selection;
            }
            else if (selection == "t")
            {
                menuOption = selection;
            }

            return(menuOption);
        }
コード例 #3
0
ファイル: Order.cs プロジェクト: NeverSettels/Bakery-2
 public static void AddPastry(Pastry pastry, int quantity)
 {
     for (int i = 0; i <= quantity; i++)
     {
         PastryOrder.Add(pastry);
     }
 }
コード例 #4
0
        public static void AddPastry(Pastry pastry, Bread bread)
        {
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Enter the # of pastries you would like to purchase:");

            int pastryNo = int.Parse(Console.ReadLine());

            if (pastryNo != 0)
            {
                pastry.PastryInvoice(pastryNo);
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.WriteLine("Bread Loaf Quantity: " + pastry.Quantity + "." + " " + "Your pastry total is: " + pastry.Price + "$");

                Console.ForegroundColor = ConsoleColor.DarkCyan;
                Console.WriteLine("Would you like to add anything else to your order? Type y to add bread or n to checkout.");
                string addBread = Console.ReadLine();
                if (addBread == "y" || addBread == "Y")
                {
                    AddBread(bread, pastry);
                }
                else
                {
                    CheckOut(bread, pastry);
                }
            }
        }
コード例 #5
0
        // Make calculations for customer order
        public static void AddToOrder(string food)
        {
            Console.WriteLine(@"(っ◔◡◔)っ ♥ How many " + food + "s would you like? ♥");
            Console.ForegroundColor = ConsoleColor.White;
            string amountString = Console.ReadLine();
            int    amount       = int.Parse(amountString);

            // Add items to order
            for (int i = 0; i < amount; i++)
            {
                orderItems.Add(food);
            }
            // Add items cost to total cost
            switch (food)
            {
            case "bread":
                Bread bread = new Bread();
                orderCost += bread.OrderBread(amount);
                break;

            case "pastry":
                Pastry pastry = new Pastry();
                orderCost += pastry.OrderPastries(amount);
                break;

            default:
                orderCost = Menu.menuItems[food] * amount;
                break;
            }
        }
コード例 #6
0
        public static void Main()
        {
            Bread  bread  = new Bread();
            Pastry pastry = new Pastry();

            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Welcome to Pierre's Bakery! Best bread and pastries since 1900");
            Console.WriteLine("Bread Loaf e/a $5.00, Pastry e/a $2.00");
            Console.WriteLine("Today's Sale: Buy 2 bread loafs & get 1 free or buy 3 pastries for $5!");
            Console.WriteLine("Start your order by selecting a product. Type bread or pastry.");

            string productSelection = Console.ReadLine();

            if (productSelection == "bread" || productSelection == "Bread" || productSelection == "BREAD")
            {
                AddBread(bread, pastry);
            }
            else if (productSelection == "pastry" || productSelection == "Pastry" || productSelection == "PASTRY")
            {
                AddPastry(pastry, bread);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Wrong entry. Please try again.");
                Main();
            }
        }
コード例 #7
0
ファイル: Order.cs プロジェクト: zakrogh/bakery-shop
 public void AddPastry(int amount)
 {
     for (int i = 0; i < amount; i++)
     {
         Pastry pastry = new Pastry();
         PastryList.Add(pastry);
     }
 }
コード例 #8
0
        static void CheckOut(Bread bread, Pastry pastry)
        {
            int checkOut = bread.Price + pastry.Price;

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Your entire purchase total is: " + checkOut + "$");
            Console.WriteLine("Thank you for visiting Pierre's Bakery. Come back soon!");
            Console.ResetColor();
        }
コード例 #9
0
ファイル: Pastry.cs プロジェクト: CodingMoore/Bakery.Solution
        public static void PastryDefault()
        {
            Pastry crossant = new Pastry("crossant", 0);
            Pastry baklava  = new Pastry("baklava", 0);
            Pastry danish   = new Pastry("danish", 0);

            _pastryCart.Add(crossant);
            _pastryCart.Add(baklava);
            _pastryCart.Add(danish);
        }
コード例 #10
0
 public static void GetPricePastry(int userAmount2)
 {
     for (int i = 1; i <= userAmount2; i++)
     {
         if (i % 3 == 0)
         {
             Pastry newPastryAmount = new Pastry("Pastry (deal)", 1);
         }
         else
         {
             Pastry newPastryAmount = new Pastry("Pastry", 2);
         }
     }
 }
コード例 #11
0
ファイル: Menu.cs プロジェクト: potrebichka/PierreBakery
        public Menu()
        {
            int index = 1;
            //breads
            Bread  bread1  = new Bread("Traditional French Baguette", 3, index);
            Bread  bread2  = new Bread("Small French Boule", 4.5, index++);
            Bread  bread3  = new Bread("Kalamata Olive", 6, index++);
            Bread  bread4  = new Bread("Walnut Raisin", 6, index++);
            Bread  bread5  = new Bread("Brioche", 7.5, index++);
            Bread  bread6  = new Bread("Whole Wheat Multi-Grain", 6.5, index++);
            Pastry pastry1 = new Pastry("Butter Croissant", 3, index);
            Pastry pastry2 = new Pastry("Chocolate Croissant", 3.5, index++);
            Pastry pastry3 = new Pastry("Almond Croissant", 3.5, index++);
            Pastry pastry4 = new Pastry("Chocolate Almond Croissant", 4, index++);
            Pastry pastry5 = new Pastry("Raspberry Almond Croissant", 4, index++);
            Pastry pastry6 = new Pastry("Pistachio White Chocolate Almond Croissant", 5, index++);

            Items = new BakeryItem[] { bread1, bread2, bread3, bread4, bread5, bread6, pastry1, pastry2, pastry3, pastry4, pastry5, pastry6 };
        }
コード例 #12
0
ファイル: Program.cs プロジェクト: Zahnen/bakery
        public static void Main()
        {
            Console.WriteLine("Welcome to Zahnen's Bakery! We sell fresh boules of sourdough ($5.00 per boule) and a rotating daily pastry ($2.00 per pastry). We're running a special on both items. For every two boules you buy, we'll throw in a third for free. For every 2 pastries you buy, we'll offer a third for half off. Enter the number of sourdough boules you'd like to buy:");
            string userBreadQuant = Console.ReadLine();
            int    BreadQuant     = int.Parse(userBreadQuant);

            Console.WriteLine("Wonderful. Would you like any of our daily pastries? Today we're offering pistachio pinwheels. Enter the number of pinwheels you'd like to buy:");
            string userPastryQuant = Console.ReadLine();
            int    PastryQuant     = int.Parse(userPastryQuant);
            Bread  userBread       = new Bread(5, BreadQuant);
            Pastry userPastry      = new Pastry(2, PastryQuant);
            int    BreadTotal      = userBread.GetBreadTotal();
            int    PastryTotal     = userPastry.GetPastryTotal();
            int    GrandTotal      = BreadTotal + PastryTotal;

            Console.WriteLine("Sounds good. Your order confirmation is listed below.");
            Console.WriteLine("ZAHNEN'S BAKERY");
            Console.WriteLine("    ------");
            Console.WriteLine("Number of Boules:" + userBreadQuant);
            Console.WriteLine("Number of Pastries:" + userPastryQuant);
            Console.WriteLine("Grand Total: $" + GrandTotal + ".00.");
        }
コード例 #13
0
ファイル: Program.cs プロジェクト: chyoon2/Bakery.Solution
        public static void Main()
        {
            Console.WriteLine("Welcome to Pierre's Bakery! Our specials today are Bread: Buy 2, get 1 free. A single loaf costs $5 & Pastry: Buy 1 for $2 or 3 for $5.");
            string purchase = "";

            while (!(purchase == "NO"))
            {
                Console.WriteLine("How many loaves of Bread would you like?)");
                string stringBreadInput = Console.ReadLine();
                int    breadInput       = int.Parse(stringBreadInput);
                Bread  newBread         = new Bread(breadInput);
                newBread.AddToList();

                Console.WriteLine("How many pastries would you like?");
                string stringPastryInput = Console.ReadLine();
                int    pastryInput       = int.Parse(stringPastryInput);
                Pastry newPastry         = new Pastry(pastryInput);
                newPastry.AddToList();

                int subtotalBread  = newBread.CalculateCost();
                int subtotalPastry = newPastry.CalculateCost();
                int grandTotal     = subtotalBread + subtotalPastry;
                Console.WriteLine("Your grand total is: $" + grandTotal);

                Console.WriteLine("Would you like more bread or pastry? Yes/No");
                purchase = Console.ReadLine().ToUpper();
                if (purchase == "YES")
                {
                }
                else if (!(purchase == "NO" || purchase == "YES"))
                {
                    while (!(purchase == "NO" || purchase == "YES"))
                    {
                        Console.WriteLine("Please answer yes or no");
                        purchase = (Console.ReadLine()).ToUpper();
                    }
                }
            }
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: meganhepner/bakery
        public static void Main()
        {
            Console.WriteLine("Welcome to Pierre's Bakery! Press ['Y'] to see today's offerings");
            string menu      = Console.ReadLine();
            Bread  newBread  = new Bread(0);
            Pastry newPastry = new Pastry(0);

            if (menu == "Y" || menu == "y")
            {
                Console.WriteLine("Whole Wheat Loaves $6");
                Console.WriteLine("**Sale!** Sourdough Boules $5 or Buy 2 Get 1 Free");
                Console.WriteLine("**Sale!** Sugar Cookies $2 or 3 for $5");
                Console.WriteLine("How many Whole Wheat Loaves would you like to purchase? If none, please enter 0!");
                string wholeWheat      = Console.ReadLine();
                int    wholeWheatOrder = int.Parse(wholeWheat);
                newBread.AddOrderToList(wholeWheatOrder * 6);
                Console.WriteLine("That will be $" + (wholeWheatOrder * 6));
                Console.WriteLine("How many Sourdough Boules would you like to purchase? If none, please enter 0!");
                string userBreadInput = Console.ReadLine();
                int    breadOrder     = int.Parse(userBreadInput);
                int    breadTotal     = newBread.TallyBreadOrder(breadOrder);
                newBread.AddOrderToList(breadTotal);
                Console.WriteLine("That will be $" + breadTotal);
                Console.WriteLine("How many pastries would you like to purchase? If none, please enter 0!");
                string userPastryInput = Console.ReadLine();
                int    pastryOrder     = int.Parse(userPastryInput);
                int    pastryTotal     = newPastry.TallyPastryOrder(pastryOrder);
                newPastry.AddOrderToList(pastryTotal);
                Console.WriteLine("That will be $" + pastryTotal);
                // Console.Write("Your order total is $" + (breadTotal + pastryTotal));
                Console.WriteLine("Your total today will be $" + (newBread.TotalBreadOrder() + newPastry.TotalPastryOrder()) + ". Thankyou for shopping at Pierre's!");
            }
            else
            {
                Main();
            }
        }
コード例 #15
0
        public static void Main()
        {
            try
            {
                Console.WriteLine("Please enter the number of Loaves you'd like.");
                Console.WriteLine("Bread is 5 Ruppees a loaf and buy 2, get 1 free!");
                string breadOrder       = Console.ReadLine();
                int    breadOrderNumber = Int32.Parse(breadOrder);
                Bread  loaves           = new Bread(breadOrderNumber);

                Console.WriteLine("Please enter the number of Pastries you'd like.");
                Console.WriteLine("Pastries are 2 Ruppees each, or 3 for 5!");
                string pastryOrder       = Console.ReadLine();
                int    pastryOrderNumber = Int32.Parse(pastryOrder);
                Pastry pastries          = new Pastry(pastryOrderNumber);
                Console.WriteLine("The Price for Bread is: " + " " + loaves.BreadPrice() + " " + "Ruppees");
                Console.WriteLine("The Price for Pastries is: " + " " + pastries.PastryPrice() + " " + "Ruppees");
                Order total = new Order(loaves.BreadPrice(), pastries.PastryPrice());
                Console.WriteLine("The Total Price of Your Order is: " + " " + total.OrderTotal + " " + "Ruppees");
                Console.WriteLine("If you would like to place another order, enter Y, all other input will end program.");
                string cont = Console.ReadLine();
                if (cont == "Y")
                {
                    Console.WriteLine("Here We Go Again!");
                    Main();
                }
                else
                {
                    Console.WriteLine("Thanks for Stopping By! There's Monsters Out There, Travel Safe!");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + " " + "Please Pay Attention to the Prompts. Only The Suggested Inputs are Valid");
                Main();
            }
        }
コード例 #16
0
        static void Main()
        {
            Console.WriteLine("≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥");
            Console.WriteLine("           Welcome to Boulangerie de Pierre!           ");
            Console.WriteLine("≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥≤≥");
            Console.WriteLine("         We have two deals going on right now:");
            Console.WriteLine("              Bread is 'Buy 2 get 1 FREE!");
            Console.WriteLine("        Pastries are 'Buy 1 for $2 or 3 for $5!");
            Console.WriteLine("_______________________________________________________");
            Console.WriteLine("                Normal Price of Bread: $5");
            Console.WriteLine("              Normal Price of Pastries: $2");
            Console.WriteLine("_______________________________________________________");
            Console.WriteLine("                 START YOUR ORDER BELOW!");
            Console.WriteLine("_______________________________________________________");
            Console.WriteLine(" 1. View Order       2.Add to Order       3.See Total");
            string userInput1 = Console.ReadLine();

            if (userInput1 == "1")
            {
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("        Here is your Itemized order so far:");
                Console.WriteLine("_______________________________________________________");
                List <Bread> BreadResult = Bread.GetAll();
                Bread.GetAll().ForEach(i => Console.WriteLine(i.BreadDescription + " $" + i.BreadPrice));
                List <Pastry> pastryResult = Pastry.GetAll();
                Pastry.GetAll().ForEach(i => Console.WriteLine(i.PastryDescription + " $" + i.PastryPrice));
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("                 Would you like to do?");
                Console.WriteLine("  1. Clear Order                         2. Main Menu");
                Console.WriteLine("_______________________________________________________");
                string userInput2 = Console.ReadLine();
                if (userInput2 == "1")
                {
                    Console.WriteLine("                 Your Order is Cleared");
                    Bread.ClearAll();
                    Pastry.ClearAll();
                    Program.Main();
                }
                else if (userInput2 == "2")
                {
                    Program.Main();
                }
                else
                {
                    Console.WriteLine("Program Terminated. Please use the command 'dotnet run' to begin... again.");
                }
            }
            else if (userInput1 == "2")
            {
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("       What would you like to add to your order?");
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("       1. Bread                        2. Pastry");
                Console.WriteLine("_______________________________________________________");
                string userInput3 = Console.ReadLine();
                if (userInput3 == "1")
                {
                    Console.WriteLine("_______________________________________________________");
                    Console.WriteLine("      How many Bread loafs would you like to add?");
                    Console.WriteLine("_______________________________________________________");
                    int userAmount1 = int.Parse(Console.ReadLine());
                    Bread.GetPriceBread(userAmount1);
                    Console.WriteLine("_______________________________________________________");
                    Console.WriteLine("               Bread added to order");
                    Console.WriteLine("_______________________________________________________");
                    Program.Main();
                }
                else if (userInput3 == "2")
                {
                    Console.WriteLine("_______________________________________________________");
                    Console.WriteLine("      How many Pastries would you like to add?");
                    Console.WriteLine("_______________________________________________________");
                    int userAmount2 = int.Parse(Console.ReadLine());
                    Pastry.GetPricePastry(userAmount2);
                    Console.WriteLine("_______________________________________________________");
                    Console.WriteLine("               Pastries added to order");
                    Console.WriteLine("_______________________________________________________");
                    Program.Main();
                }
                else
                {
                    Console.WriteLine("Program Terminated. Please use the command 'dotnet run' to begin... again.");
                }
            }
            else if (userInput1 == "3")
            {
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("                 Here Is your Order:");
                Console.WriteLine("_______________________________________________________");
                int BreadTotal = 0;
                Bread.GetAll().ForEach(i => BreadTotal += i.BreadPrice);
                Console.WriteLine("Bread: $" + BreadTotal);
                int PastryTotal = 0;
                Pastry.GetAll().ForEach(i => PastryTotal += i.PastryPrice);
                Console.WriteLine("Pastry: $" + PastryTotal);
                int GrandTotal = BreadTotal + PastryTotal;
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("       Your Order Total is: " + "$" + GrandTotal);
                Console.WriteLine("_______________________________________________________");
                Console.WriteLine("        Press any key to go back to main Menu");
                Console.WriteLine("_______________________________________________________");
                Console.ReadLine();
                Program.Main();
            }
            else
            {
                Console.WriteLine("Please choose an option from the numerical list");
                Console.WriteLine("Program is terminated, please use the command 'dotnet run' to start");
            }
        }
コード例 #17
0
ファイル: Pastry.cs プロジェクト: CodingMoore/Bakery.Solution
        public static int PastryPrice()
        {
            int total = (Pastry.PastryCount() * 2) - ((Pastry.PastryCount() / 3) * 1);

            return(total);
        }
コード例 #18
0
        public static void Main()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.BackgroundColor = ConsoleColor.Black;

            string bakeryAscii = @"
                          ....
                      .'      `.
                    .' .-'``-._ `.
                    |  / -    - ` |
                    / |'<o>  <o> | \
                    (|    '`    |) 
                      \  -==-  /   
                       `.____.'    
                        |    |     
                  _ _.'`-.__.-'`._/_
                .'| |`-.  /\  .-'| |`.
              _.'   \ \  `'  `'  / /   `._
            { `.    | `-.____.-' |    .' }
            /`. `./ /   __  __   \ \.' .'\
            /   `.| |   /  \/  \   | |.'   \
          (    (  \ \  \      /  / /  )    )
            `.   \  Y|   `.  .'   |Y  /   .'
              \   \ ||_ _ _\/_ _ _|| /   /
              `.  \|'            `|/  .'
        _______/  _ >--------------< _  \______.##._
              ((((_(                )_))))   .##. |
            / ```` `--------------' ''''\   |  | |
            ( Welcome to Faisal's Bakery! \  |  |-'
            )                             ) `--'
            (          _        _.---.__.-'
            `-.___.--' `------'

        ";

            Console.ForegroundColor = ConsoleColor.DarkBlue;
            Console.WriteLine(bakeryAscii);
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("Please [y] to place your order, [m] to view the menu and [n] to exit");

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

            if (continueAnswer == "y")
            {
                Console.WriteLine("How many loaves of bread would you like to purchase today?");
                string stringNumOfBread = Console.ReadLine();
                int    numOfBread       = checkInput(stringNumOfBread);

                if (numOfBread >= 0)
                {
                    Bread bread = new Bread();
                    bread.CalcBread(numOfBread);
                    Console.ForegroundColor = ConsoleColor.Blue;
                    Console.WriteLine("You have bought " + numOfBread + " loaves  of bread for: $" + bread.BreadPrice);
                    Console.ForegroundColor = ConsoleColor.Yellow;

                    Console.WriteLine("Would you like to buy some Pastry's today? [y] or [n]");

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

                    if (pastryAnswer == "y")
                    {
                        Console.WriteLine("Please enter the number of pastry's you would like to buy:");

                        string stringNumOfPastry = Console.ReadLine();
                        int    numOfPastry       = 0;

                        bool checkPastryInput = Int32.TryParse(stringNumOfPastry, out numOfPastry);

                        if (checkPastryInput == true)
                        {
                            if (numOfPastry >= 0)
                            {
                                Pastry pastry = new Pastry();
                                pastry.CalcPastry(numOfPastry);
                                Console.ForegroundColor = ConsoleColor.Blue;
                                Console.WriteLine("You have bought " + numOfBread + " loaves  of bread for: $" + bread.BreadPrice);
                                Console.WriteLine("You have bought " + numOfPastry + " pastry's for $" + pastry.PastryPrice);

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

                                int total = bread.BreadPrice + pastry.PastryPrice;

                                Console.WriteLine("Your total bill is $" + total);

                                Console.ForegroundColor = ConsoleColor.Gray;
                                Console.WriteLine("Goodbye");
                            }
                            else
                            {
                                ErrorNegativeNumber();
                            }
                        }
                        else
                        {
                            Error();
                        }
                    }
                    else if (pastryAnswer == "n")
                    {
                        Console.WriteLine("Thank you for coming in, your total bill is $" + bread.BreadPrice);
                        Console.WriteLine("Goodbye");
                    }
                    else
                    {
                        Error();
                    }
                }
                else if (numOfBread == -1000)
                {
                    Error();
                }
                else
                {
                    ErrorNegativeNumber();
                }
            }
            else if (continueAnswer == "m")
            {
                Menu();
            }
            else if (continueAnswer == "n")
            {
                Console.WriteLine("Goodbye");
            }
            else
            {
                Error();
            }
        }
コード例 #19
0
ファイル: Order.cs プロジェクト: misakimichy/pierre-bakery
 public void AddPastry(Pastry pastry)
 {
     PastryOrder.Add(pastry);
 }
コード例 #20
0
        static void Main()
        {
            Bread  newBreadOrder  = new Bread(5);
            Pastry newPastryOrder = new Pastry(2);
            Order  newOrder       = new Order(0, 0, 0, 0);

            Console.WriteLine("Welcome to Fresh Out the Coven Bakery!");
            Console.WriteLine("Please take a look at our menu before placing your order:");
            Console.WriteLine("===========================================");
            Console.WriteLine("   Breads   $5      ||      Pastries  $2   ");
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("      French        ||      Sweet Bun      ");
            Console.WriteLine("     Italian        ||     Cinnamon Bun    ");
            Console.WriteLine("       Rye          ||       Danish        ");
            Console.WriteLine("     Sourdough      ||      Croissant      ");
            Console.WriteLine("      Brioche       ||       Eclaire       ");
            Console.WriteLine("    Whole Grain     ||      Bear Claw      ");
            Console.WriteLine("    Olive Loaf      ||      Swiss Roll     ");
            Console.WriteLine("     Pretzel        ||      Panettone      ");
            Console.WriteLine("-------------------------------------------");
            Console.WriteLine("              ~DAILY DEALS~                ");
            Console.WriteLine("             Breads: 2 for 1               ");
            Console.WriteLine("            Pastries 3 for $5              ");
            Console.WriteLine("===========================================");
            Console.WriteLine("      Please place your order here:        ");
            Console.WriteLine("Please list the BREADS you would you like, separated by commas:");
            string breads = Console.ReadLine();

            Console.WriteLine("Please list the PASTRIES you would you like, separated by commas:");
            string pastries = Console.ReadLine();

            Console.WriteLine("Please confirm your order!");
            string[] breadsArr     = breads.Split(", ");
            string[] pastriesArr   = pastries.Split(", ");
            int      breadsTotal   = breadsArr.Length;
            int      pastriesTotal = pastriesArr.Length;
            int      costB         = newBreadOrder.Bogo(breadsTotal);
            int      costP         = newPastryOrder.PastDeal(pastriesTotal);
            int      orderCost     = costB + costP;

            Console.WriteLine("Your current order:");
            newOrder.newBreadsOrder(breadsArr);
            newOrder.newPastriesOrder(pastriesArr);
            Console.WriteLine("The total for your BREADS is: $" + costB + ".00");
            Console.WriteLine("The total for your PASTRIES is: $" + costP + ".00");
            Console.WriteLine("The grand total for your order is: $" + orderCost + ".00");
            Console.WriteLine("Is this correct? y/n");
            string response = Console.ReadLine();

            if (response == "n")
            {
                newOrder.newBreadsOrder(breadsArr);
                Console.WriteLine("The total for your BREADS is: $" + costB);
                newOrder.newPastriesOrder(pastriesArr);
                Console.WriteLine("The total for your PASTRIES is: $" + costP);
                Console.WriteLine("The grand total for your order is: $" + orderCost + ".00");
                Console.WriteLine("Please confirm your order!");
                Console.WriteLine("Is this correct? y/n");
                response = Console.ReadLine();
            }
            else if (response == "y")
            {
                Console.WriteLine("Would you like to submit your order? (y/n");
                string confirm = Console.ReadLine();
                if (confirm == "y")
                {
                    Console.WriteLine("Processing order...");
                    Console.WriteLine("YOUR ORDER HAS BEEN PLACED!");
                    Console.WriteLine("+++++++order+summary+++++++");
                    newOrder.newBreadsOrder(breadsArr);
                    newOrder.newPastriesOrder(pastriesArr);
                    Console.WriteLine("PAID $" + orderCost + ".00 PAID");
                }
                else if (confirm == "n")
                {
                    Console.WriteLine("Your order has been CANCELLED");
                }
            }
        }
コード例 #21
0
ファイル: ShoppingCart.cs プロジェクト: ayohana/my-bakery
 public void AddPastry(int inputOrder)
 {
     PastryOrder = new Pastry(inputOrder);
 }