// Show pastry menu and instantiate the pastry class based on the user input public static int GetPastryMenu() { Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Console.WriteLine(" Pastry Menu"); Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Console.WriteLine("Enter 1 for Croissant: $5"); Console.WriteLine("Enter 2 for Pain au Chocolat: $7"); Console.WriteLine("Enter 3 for Mixed Berry Danish: $9"); Console.WriteLine("Please enter the number from 1 - 3"); int userInput = int.Parse(Console.ReadLine()); Pastry pastry = null; switch (userInput) { case 1: pastry = new Pastry("Croissant", 5); break; case 2: pastry = new Pastry("Pain au Chocola", 7); break; case 3: pastry = new Pastry("Mixed Berry Danish", 9); break; default: ErrorMessage(); break; } userOrder.AddPastry(pastry); return(TakePastryOrder()); }
static void Main() { Console.WriteLine("Ciao!"); Console.WriteLine("We have some specials today so let me fill you in"); Console.WriteLine("Today our bread which is $5 a loaf is buy 2 get one free and"); Console.WriteLine("our Pastry which is $2 a piece is $5 for 3 of them."); Console.WriteLine("Would you like to make an order? 'Y' for yes, 'Enter' for no"); string answer = Console.ReadLine(); if (answer == "Y" || answer == "y") { Console.WriteLine("Terrific! how many loafs of Bread can i get for you?"); int breadQuantity = int.Parse(Console.ReadLine()); Bread newBread = new Bread(breadQuantity); if (breadQuantity >= 0) { Console.WriteLine("Terrific! how many pastry ya want?"); } int pastryQuantity = int.Parse(Console.ReadLine()); Pastry newPastry = new Pastry(pastryQuantity); if (pastryQuantity >= 0) { newBread.BreadTotal(breadQuantity); newPastry.PastryTotal(pastryQuantity); Console.WriteLine(" The cost of your the bread is $" + newBread.Total + " and your Pastries come to a total of $" + newPastry.Total); Console.WriteLine("Grazie Mille Tutti! Ciao!"); Console.WriteLine("type 'dotnet run' to make another order"); } } }
static void Main() { Console.WriteLine("---------------------------------------------------------"); Console.WriteLine("Welcome to Pierre's Bakery! Our loaves of bread are $5 and our pastries are only $2!"); Console.WriteLine("We have a couple specials going on at the moment:"); Console.WriteLine("Buy 2 any loaves of bread, get 1 free!"); Console.WriteLine("Buy any pastry for $2 or 3 for $5!"); Console.WriteLine("---------------------------------------------------------"); Console.WriteLine("Please enter the number of loaves of bread you'd like to order today:"); Console.WriteLine("---------------------------------------------------------"); int UserBreadInput = int.Parse(Console.ReadLine()); Bread userBread = new Bread(UserBreadInput, 0); Console.WriteLine("Please enter the number of patries you'd like to order today:"); Console.WriteLine("---------------------------------------------------------"); int UserPastryInput = int.Parse(Console.ReadLine()); Pastry userPastry = new Pastry(UserPastryInput, 0); userBread.BreadDeal(UserBreadInput); userPastry.PastryDeal(UserPastryInput); int Total = userPastry.PastryCost + userBread.BreadCost; Console.WriteLine("Your total today will be $" + Total + "! Thank you for your order of " + userBread.BreadLoaves + " loaves of bread and " + userPastry.PastryNumber + " pastries today, we hope to see you again soon!"); Console.WriteLine("---------------------------------------------------------"); }
public static void Main() { Bread baguette = new Bread("Baguette", 2); Bread bagel = new Bread("Bagel", 3); Bread loaf = new Bread("Loaf", 3); Bread bolillo = new Bread("Bolillo", 4); Pastry donut = new Pastry("Donut", 2); Pastry cookie = new Pastry("Cookie", 3); Pastry muffin = new Pastry("Muffin", 3); Pastry chocoroll = new Pastry("Chocoroll", 4); List <Bread> availabeBread = new List <Bread> { baguette, bagel, loaf, bolillo }; List <Pastry> availabePastry = new List <Pastry> { donut, cookie, muffin, chocoroll }; List <Bread> selectedBread = new List <Bread> { }; List <Pastry> selectedPastry = new List <Pastry> { }; TypeFast(_bakeryArt); TypeSlow("You see Pierre's in the distance would you like to go in? y/n "); string res = Console.ReadLine().ToLower(); if (yesOrNo(res)) { DisplayOptions(availabeBread, availabePastry); Ordering(availabeBread, availabePastry, selectedBread, selectedPastry); } else { TypeSlow("Good Bye! Have a great day and come back soon!"); } }
public static void Main() { Console.WriteLine("Hello, and welcome to Pierre's Bakery!"); Console.WriteLine("Here's our menu:"); Console.WriteLine("------------------------------------------------"); Console.WriteLine(Bread.MenuMessage); Console.WriteLine(Pastry.MenuMessage); Console.WriteLine("------------------------------------------------"); Console.WriteLine("May I take your order?"); Console.WriteLine("How may loaves of bread would you like?"); int breadCount = int.Parse(Console.ReadLine()); Console.WriteLine("How many pastries would you like?"); int pastryCount = int.Parse(Console.ReadLine()); Bread breadOrder = new Bread(breadCount); Pastry pastryOrder = new Pastry(pastryCount); int total = breadOrder.TotalPrice + pastryOrder.TotalPrice; Console.WriteLine("The total cost of " + breadOrder.Count + " loaves of bread is $" + breadOrder.TotalPrice + "."); Console.WriteLine("The total cost of " + pastryOrder.Count + " pastries is $" + pastryOrder.TotalPrice + "."); Console.WriteLine("So, your total comes to $" + total + "!"); }
public static void MainMenu() { Console.WriteLine("please type in 'bread' for bread options or 'pastry' for pastry options."); string menuOption = Console.ReadLine().ToLower(); if (menuOption == "bread") { Console.WriteLine("Todays specials! Buy 2, get 1 free. A single loaf costs $5."); Console.WriteLine("How many loafs would you like to order?"); int breadOrder = int.Parse(Console.ReadLine()); Bread newBreadOrder = new Bread(breadOrder); int firstBreadOrder = newBreadOrder.AddBreadCost(); totalBreadList.Add(firstBreadOrder); Console.WriteLine($"Total: ${newBreadOrder.AddBreadCost()}"); CheckOut(); } else if (menuOption == "pastry") { Console.WriteLine("Todays specials! Buy 1 for $2 or 3 for $5."); Console.WriteLine("How many pastries would you like to order?"); int pastryOrder = int.Parse(Console.ReadLine()); Pastry newPastryOrder = new Pastry(pastryOrder); int firstPastryOrder = newPastryOrder.AddPastryItem(); totalBreadList.Add(firstPastryOrder); Console.WriteLine($"Total: ${newPastryOrder.AddPastryItem()}"); CheckOut(); } }
public void DisplayOrder() { Interaction.AddSpace(); Console.WriteLine("Your current order:"); Console.WriteLine("Bread: "); double breadSubTotal = 0; foreach (KeyValuePair <Product, int> breadPair in Order.Where(pair => pair.Key.Type == "Bread")) { Bread bread = (Bread)breadPair.Key; Console.WriteLine(" + Qty " + (breadPair.Value) + " - " + (bread.IsGlutenFree ? "Gluten free bread " : "Bread ") + "that is " + (bread.IsSliced ? "sliced" : "a whole loaf")); Console.WriteLine("Price: $" + breadPair.Key.DefaultCost.ToString() + " each"); breadSubTotal += (breadPair.Key.DefaultCost * breadPair.Value); } Console.WriteLine("Bread Subtototal: " + breadSubTotal.ToString()); Console.WriteLine(""); Console.WriteLine("Pastry: "); char[] vowels = { 'a', 'e', 'i', 'o', 'u' }; double pastrySubtotal = 0; foreach (KeyValuePair <Product, int> pastryPair in Order.Where(pair => pair.Key.Type == "Pastry")) { Pastry pastry = (Pastry)pastryPair.Key; Console.WriteLine(" + Qty " + (pastryPair.Value) + " - " + (pastry.IsSavory ? "Savory " : "Sweet ") + "pastry in the shape of a" + (vowels.Contains(pastry.Shape[0]) ? "n " + pastry.Shape : " " + pastry.Shape)); Console.WriteLine("Price: $" + pastryPair.Key.DefaultCost.ToString() + " each"); pastrySubtotal += (pastryPair.Key.DefaultCost * pastryPair.Value); } Console.WriteLine("Pastry Subtototal: " + pastrySubtotal.ToString()); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Total Cost: " + (breadSubTotal + pastrySubtotal).ToString()); }
public static void Main() { Console.WriteLine("Welcome to Pierre's Bakery!"); Console.WriteLine("---------------------------"); Console.WriteLine("We've got the best baguettes & croissant in town,"); Console.WriteLine("baguettes are $5.00/ea, croissant are $2.00/ea."); Console.WriteLine("We're running a special: buy 2 baguette get one free and"); Console.WriteLine("buy 3 croissant for $5.00"); Console.WriteLine("---------------------------"); Console.WriteLine("How many baguette would you like?"); string stringNumberOfBread = Console.ReadLine(); int numberOfBread = int.Parse(stringNumberOfBread); Bread breadOrder = new Bread(numberOfBread); Console.WriteLine("How many croissant would you like?"); string stringNumberOfPastry = Console.ReadLine(); int numberOfPastry = int.Parse(stringNumberOfPastry); Pastry pastryOrder = new Pastry(numberOfPastry); string orderSummary = $"Your order: {numberOfBread} baguette and {numberOfPastry} croissant."; Console.WriteLine(orderSummary); int totalOrder = breadOrder.BreadCost() + pastryOrder.PastryCost(); string receipt = $"With your discounts, your order comes to ${totalOrder}"; Console.WriteLine(receipt); Console.WriteLine("Thank you for coming to Pierre's, hope to see you again soon!"); }
public static void Shop() { Console.Clear(); Console.WriteLine("Please Enter which you would like to buy:"); Console.WriteLine("[BREAD] [PASTRY]"); string productChoice = Console.ReadLine(); if (productChoice.ToLower() == "bread") { Console.WriteLine("Please enter the number of loaves you would like:"); int breadCount = int.Parse(Console.ReadLine()); Console.WriteLine("You have ordered " + breadCount + " loaves!"); Bread.BreadPricing(breadCount); ReturnMenu(); } else if (productChoice.ToLower() == "pastry") { Console.WriteLine("Please enter the number of pastries you would like:"); int pastryCount = int.Parse(Console.ReadLine()); Console.WriteLine("You have ordered " + pastryCount + " pastries!"); Pastry.PastryPricing(pastryCount); ReturnMenu(); } else { Shop(); } }
public static void StartBakery() { Console.WriteLine("Welcome to my Bakery please enter in how many pastries you would like to purchase today?"); int aNumber = int.Parse(Console.ReadLine()); Pastry pastry1 = new Pastry(aNumber); pastry1.CalculatePastryPrice(); Console.WriteLine(pastry1.Price); Console.WriteLine("Enter in how many loafs of bread"); int anotherNumber = int.Parse(Console.ReadLine()); Bread bread = new Bread(anotherNumber); bread.CalculateBreadPrice(); Console.WriteLine(bread.Price); Console.WriteLine("Would you like to add to your order?"); string answer = Console.ReadLine(); if (answer == "y") { // recursive function StartBakery(); } else { // // show total price Program.GetList(); System.Environment.Exit(2); } }
public static void Main() { //CONSTRUCTORS FOR BAKERY ITEMS Bread wholeGrain = new Bread(1, "WholeGrain", 3); Bread white = new Bread(2, "White", 3); Bread sourdough = new Bread(3, "Sourdough", 3); List <Bread> breadList = new List <Bread>() { wholeGrain, white, sourdough }; List <Bread> breadCart = new List <Bread>(0); Pastry plainDonut = new Pastry(1, "PlainDonut", 2); Pastry chocolateDonut = new Pastry(2, "ChocolateDonut", 2); Pastry vanillaCupcake = new Pastry(3, "VanillaCupcake", 2); Pastry strawberryCupcake = new Pastry(4, "StrawberryCupcake", 2); Pastry chocolateCupcake = new Pastry(5, "ChocolateCupcake", 2); List <Pastry> pastryList = new List <Pastry>() { plainDonut, chocolateDonut, vanillaCupcake, strawberryCupcake, chocolateCupcake }; List <Pastry> pastryCart = new List <Pastry>(0); StartShopping(breadList, breadCart, pastryList, pastryCart); }
public static void Main() { Console.WriteLine("Welcome to Pierre's Bakery!"); Console.WriteLine(" _______"); Console.WriteLine(" / )"); Console.WriteLine(" /_____ |"); Console.WriteLine("( ' ) /"); Console.WriteLine(" |. '| / "); Console.WriteLine(" |____|/ \n"); Console.WriteLine("A loaf of bread is $5 for one or Buy one get one free."); Console.WriteLine("A pastry is $2 for one or 3 for $5 or 12 for $18.\n"); try { Console.WriteLine("How many loafs of bread would you like?"); int loafs = int.Parse(Console.ReadLine()); Console.WriteLine("How many pastries would you like?"); int pastries = int.Parse(Console.ReadLine()); Bread newBreadOrder = new Bread(loafs); int breadPrice = newBreadOrder.CalcBreadPrice(); Pastry newPastryOrder = new Pastry(pastries); int pastryPrice = newPastryOrder.CalcPastryPrice(); Console.WriteLine($"Your order total comes to ${breadPrice + pastryPrice}."); Console.WriteLine("Have a great day!"); } catch { Console.WriteLine("Oops! Please only enter numbers. Please try again."); Main(); } }
public static void Main() { Console.WriteLine("########### PIERRES BAKERY ###########"); Console.WriteLine("########### Welcome! ###########"); Console.WriteLine("Welcome!, to Pierre's Bakery! Where we sell high quality artisan breads and pastries at the best prices!"); Console.WriteLine("For a limited time, enjoy our special offers when ordering from Pierre."); Console.WriteLine("Right now, our breads are $5 each, and if you buy 2 you get the third one free!!"); Console.WriteLine("And our Pastrys are $2 each, or for $5 if you buy 3!!"); Console.WriteLine("#######################################"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("How many orders of Bread would you like to purchase?"); int breadOrder = int.Parse(Console.ReadLine()); Bread breadNumber = new Bread(breadOrder); Console.WriteLine(); Console.WriteLine("And how many pastries would you like to add?"); int pastryOrder = int.Parse(Console.ReadLine()); Pastry pastryNumber = new Pastry(pastryOrder); Console.WriteLine(); int breadTotal = breadNumber.FindTotal(); int pastryTotal = pastryNumber.FindTotal(); int finalTotal = breadTotal + pastryTotal; Console.WriteLine("Your order total is: $" + finalTotal + ".00. Thank you for your purchase."); }
public static void Main() { Console.WriteLine(" Welcome to Pusheen's Bakery"); Console.WriteLine("🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞🍞"); Console.WriteLine(" 🍞🍞🍞🍞🍞 Bread 🍞🍞🍞🍞🍞 "); Console.WriteLine(" One Loaf is $5"); Console.WriteLine("🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐🥐"); Console.WriteLine("🥐🥐🥐🥐🥐 Pastries 🥐🥐🥐🥐🥐"); Console.WriteLine(" One Pastry is $2"); Console.WriteLine("🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎"); Console.WriteLine("Pusheen Specials: Buy More, Save More!"); Console.WriteLine("BOGO Bread || Buy 🍞🍞 get one FREE"); Console.WriteLine("Pastry Me || Buy 🥐🥐🥐 for $5"); Console.WriteLine("🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎"); //user input for bread Console.WriteLine("How much Bread would you like?"); int userBread = int.Parse(Console.ReadLine()); Bread newBread = new Bread(userBread); int finalBread = newBread.FinalBreadCost(); //user input for pastries Console.WriteLine("How many Pastries would you like?"); int userPastry = int.Parse(Console.ReadLine()); Pastry newPastry = new Pastry(userPastry); int finalPastry = newPastry.FinalPastryCost(); Console.WriteLine("🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎🤎"); //total amount of bread + pastry cost Console.WriteLine("Your Pusheen Total: $" + (finalBread + finalPastry)); Console.WriteLine("Thank you for your order ~ Pusheen"); }
public static void Main() { Console.WriteLine("Welcome to Pierre's Bakery!"); Console.WriteLine("Here is our menu:"); Console.WriteLine("Bread: $5 per loaf. Buy 2, Get 1 free!"); Console.WriteLine("Pastry: $2 each. Get 3 for $5!"); Console.WriteLine("How many bread loaves would you like to order?"); bool breadOrderSuccess = int.TryParse(Console.ReadLine(), out int breadOrder); while ((breadOrderSuccess == false) || (breadOrder < 0)) { Console.WriteLine("That is not a valid input. Please enter the number of bread loaves you would like. Enter 0 if you do not want any bread loaves."); breadOrderSuccess = int.TryParse(Console.ReadLine(), out breadOrder); } Console.WriteLine("How many pastries would you like to order?"); bool pastryOrderSuccess = int.TryParse(Console.ReadLine(), out int pastryOrder); while (!pastryOrderSuccess || (pastryOrder < 0)) { Console.WriteLine("That is not a valid input. Please enter the number of pastries you would like. Enter 0 if you do not want any pastries."); pastryOrderSuccess = int.TryParse(Console.ReadLine(), out pastryOrder); } Bread newBread = new Bread(breadOrder); Pastry newPastry = new Pastry(pastryOrder); newBread.CalculateBreadCost(); int breadCost = newBread.Cost; newPastry.CalculatePastryCost(); int pastryCost = newPastry.Cost; Console.WriteLine("Thank you for your order! Your total is: $" + (breadCost + pastryCost)); }
public static void Main() { string welcome = "Welcome to Pierre's Bakery! \n" + "We're the only organic bakery on the Moon and our deals are out of this world!. \n" + "We sell Moon Bread and Space Pastries. \n" + "Bread costs 5 moon rocks a loaf, and every 3rd loaf you buy is free. \n" + "Pastries cost 2 moon rocks each, and every 3rd pastry is half off. \n" + "\n" + "And don't even think of trying to fool us with plain old Earth Rocks. \n" + "The last person who tried that got launched into the void of space! \n"; Console.WriteLine(welcome); Thread.Sleep(4000); Console.WriteLine("How many loaves of bread would you like?"); int breadAmount = int.Parse(Console.ReadLine()); Thread.Sleep(1000); Console.WriteLine("And how many pastries would you like?"); int pastryAmount = int.Parse(Console.ReadLine()); Bread.Amount = breadAmount; Pastry.Amount = pastryAmount; Bread.PriceCalc(); Pastry.PriceCalc(); int totalPrice = Bread.Price + Pastry.Price; Thread.Sleep(1000); Console.WriteLine("\nGreat! That will cost you " + totalPrice + " moon rocks."); }
public static void Main() { Console.WriteLine(@" ______ __ ______ ______ ______ ______ ______ ______ ______ __ __ ______ ______ __ __ "); Console.WriteLine(@"/\ == \/\ \ /\ ___\ /\ == \ /\ == \ /\ ___\ /\ ___\ /\ == \ /\ __ \ /\ \/ / /\ ___\ /\ == \ /\ \_\ \ "); Console.WriteLine(@"\ \ _-/\ \ \\ \ __\ \ \ __< \ \ __< \ \ __\ \ \___ \ \ \ __< \ \ __ \\ \ _'-.\ \ __\ \ \ __< \ \____ \ "); Console.WriteLine(@" \ \_\ \ \_\\ \_____\\ \_\ \_\\ \_\ \_\\ \_____\\/\_____\ \ \_____\\ \_\ \_\\ \_\ \_\\ \_____\\ \_\ \_\\/\_____\ "); Console.WriteLine(@" \/_/ \/_/ \/_____/ \/_/ /_/ \/_/ /_/ \/_____/ \/_____/ \/_____/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/ \/_____/ "); Console.WriteLine(@" "); Console.WriteLine("Hello User; Welcome to the future of bread ordering!"); Console.WriteLine("We have two items for sale. Bread and Pastry."); Console.WriteLine("Bread is $5 and is on a Buy 2 Get 1 FREE special!"); Console.WriteLine("How many bread do you want?"); string stringBreadLoafs = Console.ReadLine(); Console.WriteLine("Pastries are Buy 1 for $2 or 3 for $5"); Console.WriteLine("How many Pastry do you want?"); string stringPastryItem = Console.ReadLine(); int userBreadLoafs = int.Parse(stringBreadLoafs); int pastryItem = int.Parse(stringPastryItem); Bread userBread = new Bread(userBreadLoafs); int breadTotal = Bread.BreadTotal(userBreadLoafs); Pastry userPastry = new Pastry(pastryItem); int pastryTotal = Pastry.PastryTotal(pastryItem); Console.WriteLine($"Your order bread total {breadTotal} and your pastry total is {pastryTotal}"); }
public static void Start() { Console.WriteLine("How many loaves of bread would you like?"); string breadInput = Console.ReadLine(); if (numberChecker(breadInput) == false) { Console.WriteLine("Please enter a number with no spaces or extra characters"); Start(); } Console.WriteLine("How many pastries would you like?"); string pastryInput = Console.ReadLine(); if (numberChecker(pastryInput) == false) { Console.WriteLine("Please enter a number with no spaces or extra characters"); Start(); } int parsedPastry = int.Parse(pastryInput); int parsedBread = int.Parse(breadInput); Bread bread1 = new Bread(parsedBread); Pastry pastry1 = new Pastry(parsedPastry); Order order1 = new Order(bread1.BreadTotal(), pastry1.PastryTotal()); Console.WriteLine("Thank you. For " + breadInput + " loaves of bread and " + pastryInput + " pastries, your total is $" + order1.OrderTotal()); }
public static int GetTotal() { int breadTotal = Bread.GetPrice(_breadCart.Count); int pastryTotal = Pastry.GetPrice(_pastryCart.Count); return(breadTotal + pastryTotal); }
//A method for placing an order public static void Order(string orderName) { Console.WriteLine($"Okay, {orderName}, how many loaves of bread would you like? They're $5 a loaf, but if you buy two, you get one for free!"); int orderBread = int.Parse(Console.ReadLine()); Console.WriteLine("How many pastries would you like? They're $2 a each, or $5 for 3!"); int orderPastry = int.Parse(Console.ReadLine()); Bread bread = new Bread(orderBread); Pastry pastry = new Pastry(orderPastry); bread.FindBreadPrice(); pastry.FindPastryPrice(); int orderTotal = bread.BreadOrderPrice + pastry.PastryOrderPrice; Console.WriteLine($"Your total is ${orderTotal}. ${bread.BreadOrderPrice} for {orderBread} loaves of bread and ${pastry.PastryOrderPrice} for {orderPastry} pastries."); Console.WriteLine($"Please send {orderTotal} to $rewpet on the cashapp."); Console.WriteLine("Would you like to make another order? y/n"); string answer = Console.ReadLine(); if (answer == "y" || answer == "Y") { Order(orderName); } else { Console.WriteLine("Thanks for your business!"); } }
public static void Main() { Console.WriteLine(" ---------------------- \n Welcome to Pierre's Bakery! \n ---------------------- \n Cost of Bread: $5.00 \n Cost of Pastry: $2.00"); Console.WriteLine(" ----------------------"); Console.WriteLine(" Today's Scpecials:\n ----------------------\n Bread: buy 2, loaves get the 3rd free. \n Pastry: buy 1, for $2.00 or 3 for $5.00. "); Console.WriteLine(" ----------------------"); Console.WriteLine(" Which pastry would you like? (0-4)"); foreach (KeyValuePair <int, string> pastry in pastrys) { Console.WriteLine(" Key: {0}, Value: {1}", pastry.Key, pastry.Value); } int flovorPastry = int.Parse(Console.ReadLine()); Console.WriteLine(" How many Pastry's would you like?"); int userPastry = int.Parse(Console.ReadLine()); Pastry customerPastry = new Pastry(userPastry, 2); customerPastry.DeterminePricePastry(userPastry); Console.WriteLine(" Which drink would you like? (0-4)"); foreach (KeyValuePair <int, string> drink in drink) { Console.WriteLine(" Key: {0}, Value: {1}", drink.Key, drink.Value); } int flovorDrink = int.Parse(Console.ReadLine()); Console.WriteLine(" How many Drink's would you like?"); int userDrink = int.Parse(Console.ReadLine()); Drink customerDrink = new Drink(userDrink, 2); customerDrink.DeterminePriceDrink(userDrink); Console.WriteLine(" Which bread would you like? (0-4)"); foreach (KeyValuePair <int, string> bread in bread) { Console.WriteLine(" Key: {0}, Value: {1}", bread.Key, bread.Value); } int flovorBread = int.Parse(Console.ReadLine()); Console.WriteLine(" How many loaves of Bread would you like?"); int userBread = int.Parse(Console.ReadLine()); Bread customerBread = new Bread(userBread, 2); customerBread.DeterminePriceBread(userBread); int totalPrice = (customerPastry.DeterminePricePastry(userPastry) + customerBread.DeterminePriceBread(userBread) + customerDrink.DeterminePriceDrink(userDrink)); Console.WriteLine(" ----------------------"); Console.WriteLine("You hava ordered: " + "" + userBread + " " + bread[flovorBread] + "(s)"); Console.WriteLine("You hava ordered: " + "" + userPastry + " " + pastrys[flovorPastry] + "(s)"); Console.WriteLine("You hava ordered: " + "" + userDrink + " " + drink[flovorPastry] + "(s)"); Console.WriteLine("Total due: $" + totalPrice + ".00"); }
public static int PastryOrder() { Pastry pastry = new Pastry("pastry", 2); Console.WriteLine("What kind of pastry would you like?"); Console.WriteLine("1: Pain au Chocolat, 2: Croissant, 3: Strudel, 4: Cream Puff, 5: Tartlet"); Console.WriteLine("Please pick a number 1-5:"); string pastryID = Console.ReadLine(); while (pastryID == "pancakes") { Console.WriteLine(@" lヽ /l |::|ヽ__/::| /、_ ,、;ヽ =|;( - |.| - );|= ヽ ----- 'ノ /`;;;‐'';| |; ;| |; ;\ i; ;ヽ i; ;|; ;|; ;| |; ;|; ;|; ; |; ;|; ;|; ;| ____,,,,,,,__ |; ;|; ;|; ;|‐;; ;ヽ "); Console.WriteLine("Jiji says don't get fat!"); Console.WriteLine("Now put in a valid pastry ID please!"); pastryID = Console.ReadLine(); } string[] pastryName = DeterminePastry(pastryID); while (pastryName[0] == "error") { Console.WriteLine("Sorry I didn't catch that! Please enter a valid pastry ID number."); pastryID = Console.ReadLine(); pastryName = DeterminePastry(pastryID); } Console.WriteLine("How many " + pastryName[0] + " would you like today?"); string pastryString = Console.ReadLine(); while (!Int32.TryParse(pastryString, out int result)) { Console.WriteLine("Sorry I didn't catch that! Please enter a number of pastries."); pastryString = Console.ReadLine(); } int pastryNumber = int.Parse(pastryString); int pastryTotalCost = Bakery.BakedGoods.Pastry.CalculatePastry(pastryNumber, pastry.Price); if (pastryNumber >= 3) { Console.WriteLine("You have an eye for deals! Pastries are 3 for $5!"); } Console.WriteLine("That will be $" + pastryTotalCost); return(pastryTotalCost); }
public static void PrintOrder() { int finalBread = Bread.GetAll(); int finalPastry = Pastry.GetAll(); double cost = Bread.BreadOrder(finalBread) + Pastry.PastryOrder(finalPastry); Console.WriteLine($"You bought {finalBread} Loaves of bread and {finalPastry} pastries for ${cost}"); Console.WriteLine("Bye!"); }
// Takes input for number of pastries to order, and returns total. // public static int PastryForm() { Console.WriteLine("Please enter the number of pastries for your purchase."); string pastryQuantity = Console.ReadLine(); int pastryQ = Int32.Parse(pastryQuantity); Pastry pastryOrder = new Pastry(pastryQ); int totalPastry = pastryOrder.Price; return(totalPastry); }
public static void SummerizeOrder(List <Bread> selectedBread, List <Pastry> selectedPastry) { int breadTotal = Bread.BreadDiscount(selectedBread); int pastryTotal = Pastry.PastryDiscount(selectedPastry); TypeSlow("Here is what you ordered: "); DisplayOptions(selectedBread, selectedPastry); TypeSlow($"And you Total is {breadTotal + pastryTotal}"); TypeSlow($"Thank you and have a great day!"); }
public static void Main() { Console.WriteLine("Welcome to Royal Bakery!"); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("What is your name?"); string custName = Console.ReadLine(); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Here is our menu:"); Console.WriteLine("--Chocolate Babka: $5/loaf or buy 2, get one free"); Console.WriteLine("--Black and White Cookie: $2 for 1 or 3 for $5"); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Please enter the number of bread loaves you would like."); int breadQty = int.Parse(Console.ReadLine()); Bread breadOrder = new Bread(breadQty); int breadTotal = breadOrder.CalcBread(breadQty); Console.WriteLine("Please enter the number of cookies would you like."); int pastryQty = int.Parse(Console.ReadLine()); Pastry pastryOrder = new Pastry(pastryQty); int pastryTotal = pastryOrder.CalcPastry(pastryQty); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Would you like to add anything else? [press 'Y' for yes or 'N' to cancel]"); string userAdd = Console.ReadLine(); if (userAdd == "y" || userAdd == "Y") { Console.WriteLine("How many loaves of bread would you like to add?"); int breadAdd = int.Parse(Console.ReadLine()); int breadAddTotal = breadOrder.AddBread(breadAdd); Console.WriteLine("How many cookies would you like to add?"); int pastryAdd = int.Parse(Console.ReadLine()); int pastryAddTotal = pastryOrder.AddPastry(pastryAdd); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Thank you for your order, " + custName + ". Your total is $" + (breadAddTotal + pastryAddTotal) + "."); Console.WriteLine("-------------------------------------------------"); } else if (userAdd == "n" || userAdd == "N") { Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Thank you for your order, " + custName + ". Your total is $" + (breadTotal + pastryTotal) + "."); Console.WriteLine("-------------------------------------------------"); } else { Console.WriteLine("Please choose a valid response."); Console.WriteLine("-------------------------------"); } }
public static int GetTotalPrice() { List <Bread> allBreadOrders = Bread.GetThatBread(); List <Pastry> allPastryOrders = Pastry.GetThePastries(); Pastry.ApplyPastryDeals(); Bread.ApplyBreadDeals(); int totalOrderPrice = Pastry.GetTotalPastryPrice() + Bread.GetTotalBreadPrice(); return(totalOrderPrice); }
public int IsPastryMade(bool isSavory, string shape) { int pastryCount = 0; Pastry pastryInList = MadePastry.Where(pastryPair => pastryPair.Key.IsSavory == isSavory && pastryPair.Key.Shape == shape).FirstOrDefault().Key; if (pastryInList != null) { pastryCount = MadePastry[pastryInList]; } return(pastryCount); }
private void MakeFirstProducts() { Bread startBread = new Bread(false, false); MadeBread = new Dictionary <Bread, int>(); MadeBread.Add(startBread, 2); Pastry startPastry = new Pastry(false, "flower"); MadePastry = new Dictionary <Pastry, int>(); MadePastry.Add(startPastry, 5); }
static void Main() { Console.WriteLine("Welcome to Pierre's Bakery! Today we have our famous country loaf for $5 or if you buy 2 you get 1 free. We also have the always delightful berry danish for $2 or 3 for $5."); Console.WriteLine("How many loaves of bread would you like?"); string strLoaves = Console.ReadLine(); Bread breadOrder = new Bread(int.Parse(strLoaves)); if (breadOrder.Loaves % 3 == 2) { Console.WriteLine("Are you sure you wouldn't like to get one more loaf? It would be free with our buy 2 get 1 free deal. If you would like to add another loaf press ['Y' for yes] or press ['Enter' for no]."); string moreBread = Console.ReadLine(); if (moreBread == "Y" || moreBread == "y") { breadOrder.AddLoaf(); } } breadOrder.TotalBread(); if (breadOrder.Loaves >= 12) { breadOrder.AddLoaf(); Console.WriteLine("Thanks for being such a great customer! Here's a loaf on me!"); } Console.WriteLine("And how many pastries can I get you today?"); string strPastries = Console.ReadLine(); Pastry pastryOrder = new Pastry(int.Parse(strPastries)); if (pastryOrder.Pastries % 3 == 2) { Console.WriteLine("Are you sure you wouldn't like to get one more pastry? It would cost only $1 more! If you would like to add another pastry press ['Y' for yes] or press ['Enter' for no]."); string anotherPastry = Console.ReadLine(); if (anotherPastry == "Y" || anotherPastry == "y") { pastryOrder.AddPastry(); } } pastryOrder.TotalPastries(); if (pastryOrder.Pastries >= 12) { pastryOrder.AddPastry(); Console.WriteLine("Thanks for being such a great customer! I threw and extra pastry in there for you!"); } Console.WriteLine($"So that's {breadOrder.Loaves} loa{(breadOrder.Loaves == 1 ? "f" : "ves")} for ${breadOrder.BreadTotal} and {pastryOrder.Pastries} pastr{(pastryOrder.Pastries == 1 ? "y" : "ies")} for ${pastryOrder.PastryTotal} your total comes to ${breadOrder.BreadTotal + pastryOrder.PastryTotal}. Is that all for you today? Press ['Y' for yes] or press ['Enter' for no]."); string finalQuestion = Console.ReadLine(); if (finalQuestion == "Y" || finalQuestion == "y") { Console.WriteLine("Thank you so much for visiting Pierre's! We look forward to your next visit!"); } else { Main(); } }