//public int PizzaCount { get { return pizzaCount; } set { } } public void StandardPizzaShoppingCart(string choise) { pizzaMenu = new PizzaMenu(); pizzaCount++; switch (choise) { case "1": WriteLine($"You have added Mozzarella to your shopping cart:\n"); break; case "2": WriteLine($"You have added Hawaii to your shopping cart:\n"); break; case "3": WriteLine($"You have added Shotgun to your shopping cart:\n"); break; case "4": WriteLine($"You have added Chippolino to your shopping cart:\n"); break; case "5": WriteLine($"You have added Americano to your shopping cart:\n"); break; case "mozzarella": WriteLine($"You have added Mozzarella to your shopping cart:\n"); break; case "hawaii": WriteLine($"You have added Hawaii to your shopping cart:\n"); break; case "shotgun": WriteLine($"You have added Shotgun to your shopping cart:\n"); break; case "chippolino": WriteLine($"You have added Chippolino to your shopping cart:\n"); break; case "americano": WriteLine($"You have added Americano to your shopping cart:\n"); break; } if (choise.Contains($"{Pizza.Mozzarella}".ToLower()) || choise == "1") { shoppingCart.Add(pizzaMenu.Menu[0].Name + " pizza:"); shoppingCart.Add(" - " + pizzaMenu.Menu[0].Price.ToString() + " €"); totalCost += PizzaMenu.Menu[0].Price; shoppingCart.Add(" - " + pizzaMenu.Menu[0].Flavor1); shoppingCart.Add(" - " + pizzaMenu.Menu[0].Flavor2); shoppingCart.Add(" - " + pizzaMenu.Menu[0].Flavor3); shoppingCart.Add(" - " + pizzaMenu.Menu[0].Flavor4); } else if (choise.Contains($"{Pizza.Hawaii}".ToLower()) || choise == "2") { shoppingCart.Add(pizzaMenu.Menu[1].Name + " pizza:"); shoppingCart.Add(" - " + pizzaMenu.Menu[1].Price.ToString() + " €"); totalCost += PizzaMenu.Menu[1].Price; shoppingCart.Add(" - " + pizzaMenu.Menu[1].Flavor1); shoppingCart.Add(" - " + pizzaMenu.Menu[1].Flavor2); shoppingCart.Add(" - " + pizzaMenu.Menu[1].Flavor3); shoppingCart.Add(" - " + pizzaMenu.Menu[1].Flavor4); } else if (choise.Contains($"{Pizza.Shotgun}".ToLower()) || choise == "3") { shoppingCart.Add(pizzaMenu.Menu[2].Name + " pizza:"); shoppingCart.Add(" - " + pizzaMenu.Menu[2].Price.ToString() + " €"); totalCost += PizzaMenu.Menu[2].Price; shoppingCart.Add(" - " + pizzaMenu.Menu[2].Flavor1); shoppingCart.Add(" - " + pizzaMenu.Menu[2].Flavor2); shoppingCart.Add(" - " + pizzaMenu.Menu[2].Flavor3); shoppingCart.Add(" - " + pizzaMenu.Menu[2].Flavor4); } else if (choise.Contains($"{Pizza.Chippolino}".ToLower()) || choise == "4") { shoppingCart.Add(pizzaMenu.Menu[3].Name + " pizza:"); shoppingCart.Add(" - " + pizzaMenu.Menu[3].Price.ToString() + " €"); totalCost += PizzaMenu.Menu[3].Price; shoppingCart.Add(" - " + pizzaMenu.Menu[3].Flavor1); shoppingCart.Add(" - " + pizzaMenu.Menu[3].Flavor2); shoppingCart.Add(" - " + pizzaMenu.Menu[3].Flavor3); shoppingCart.Add(" - " + pizzaMenu.Menu[3].Flavor4); } else if (choise.Contains($"{Pizza.Americano}".ToLower()) || choise == "5") { shoppingCart.Add(pizzaMenu.Menu[4].Name + " pizza:"); shoppingCart.Add(" - " + pizzaMenu.Menu[4].Price.ToString() + " €"); totalCost += PizzaMenu.Menu[4].Price; shoppingCart.Add(" - " + pizzaMenu.Menu[4].Flavor1); shoppingCart.Add(" - " + pizzaMenu.Menu[4].Flavor2); shoppingCart.Add(" - " + pizzaMenu.Menu[4].Flavor3); shoppingCart.Add(" - " + pizzaMenu.Menu[4].Flavor4); } }
static void Main() { OutputEncoding = Encoding.UTF8; PizzaMenu pizzaMenu = new PizzaMenu(); ShoppingCart shoppingCart = new ShoppingCart(); string firstUserChoise; string secondUserChoise; string doughUserChoise; string thirdUserChoise; WriteLine("Hello! Welcome to the PitsaKiosk!\n"); WriteLine("Menu:"); pizzaMenu.PrintMenu(); shoppingCart.PrintShoppingCart(); while (true) { WriteLine("\nMake your choise:"); WriteLine("add = add pizza | own = make your own pizza | exit = leave PitsaKiosk..."); firstUserChoise = ReadLine().ToLower(); if (firstUserChoise == "add") { Clear(); pizzaMenu.PrintMenu(); Write("Did not find what you wanted? exit = exit shop. Found? Then choose your pizza: "); var pizzaChoise = ReadLine().ToLower(); if (pizzaChoise == "exit") { Exit(); break; } Clear(); shoppingCart.StandardPizzaShoppingCart(pizzaChoise); shoppingCart.PrintShoppingCart(); WriteLine("\nWhat type of dough you want - thick or thin?: "); doughUserChoise = ReadLine().ToLower(); shoppingCart.StandardPizzaDough(doughUserChoise); WriteLine("\nCheckout?"); WriteLine("Yes = y | No = n"); secondUserChoise = ReadLine().ToLower(); if (secondUserChoise == "y") { Clear(); WriteLine("Your order is being prepared:\n"); shoppingCart.PrintShoppingCart(); break; } else if (secondUserChoise == "n") { Start: WriteLine("Want to add another pizza or change your order all together?"); WriteLine("add = add another pizza || delete = change your order"); thirdUserChoise = ReadLine().ToLower(); if (thirdUserChoise == "add") { Clear(); pizzaMenu.PrintMenu(); WriteLine("Pizza in the shopping cart:"); shoppingCart.PrintShoppingCart(); WriteLine("\nAdd another pizza of your choise: "); var pizzaAnotherChoise = ReadLine().ToLower(); shoppingCart.StandardPizzaShoppingCart(pizzaAnotherChoise); WriteLine("What type of dough you want - thick or thin?: "); doughUserChoise = ReadLine(); shoppingCart.StandardPizzaDough(doughUserChoise); Clear(); shoppingCart.PrintShoppingCart(); WriteLine("\nCheckout?"); WriteLine("Yes = y | No = n"); secondUserChoise = ReadLine().ToLower(); if (secondUserChoise == "y") { Clear(); WriteLine("Your order is being prepared:\n"); shoppingCart.PrintShoppingCart(); break; } if (secondUserChoise == "n") { goto Start; } } else if (thirdUserChoise.Contains("del")) { Clear(); WriteLine("Your order is:"); shoppingCart.PrintShoppingCart(); WriteLine("\nChoose which order to delete:"); var deletePizzaChoise = ReadLine().ToLower(); shoppingCart.EmptyStandardPizzaShoppingCart(deletePizzaChoise, doughUserChoise); Clear(); shoppingCart.PrintShoppingCart(); WriteLine("\nCheckout?"); WriteLine("Yes = y | No = n"); secondUserChoise = ReadLine().ToLower(); if (secondUserChoise == "y") { Clear(); WriteLine("Your order is being prepared:\n"); shoppingCart.PrintShoppingCart(); break; } } } } else if (firstUserChoise == "own") { } else if (firstUserChoise == "exit") { Exit(); break; } }
static void Main(string[] args) { PizzaMenu menu = new PizzaMenu(); menu.MakePizza(); }