protected override void AddToppings() { PizzaToppings.Add(new PizzaTopping("Sauce")); PizzaToppings.Add(new PizzaTopping("Cheese")); PizzaToppings.Add(new PizzaTopping("Steak")); PizzaToppings.Add(new PizzaTopping("Onions")); }
protected override void AddToppings() { PizzaToppings.Add(new PizzaTopping("Sauce")); PizzaToppings.Add(new PizzaTopping("Cheese")); PizzaToppings.Add(new PizzaTopping("Ham")); PizzaToppings.Add(new PizzaTopping("Pineapple")); }
protected override void AddToppings() { PizzaToppings.Add(new PizzaTopping("Sauce")); PizzaToppings.Add(new PizzaTopping("Cheese")); PizzaToppings.Add(new PizzaTopping("Pepperoni")); PizzaToppings.Add(new PizzaTopping("Sausage")); PizzaToppings.Add(new PizzaTopping("Steak")); }
protected override void AddToppings() { PizzaToppings.Add(new PizzaTopping("Sauce")); PizzaToppings.Add(new PizzaTopping("Cheese")); Boolean addT = true; const int maxTopppings = 5; const int minToppings = 2; while (addT) { Console.WriteLine("Choose an Action:\n 1. View current toppings\n 2. Add/Remove toppings\n 3. Done"); int.TryParse(Console.ReadLine(), out int input); switch (input) { case 1: var sb = new StringBuilder(); foreach (var t in PizzaToppings) { sb.Append($"[{t.Toppings}] "); } Console.WriteLine(sb.ToString()); break; case 2: Console.WriteLine(ToppingsToString()); PizzaTopping newTopping = new PizzaTopping(); newTopping.SelectToppings(); if (ContainsTopping(newTopping)) { RemoveTopping(newTopping); } else { PizzaToppings.Add(newTopping); } break; case 3: if (maxTopppings >= PizzaToppings.Count && PizzaToppings.Count >= minToppings) { addT = false; } else { Console.WriteLine($"must have {minToppings}-{maxTopppings} toppings on pizza"); } break; default: Console.WriteLine("Unknown input try again"); break; } } }
public App() { InitializeComponent(); MainPage = new MyTabPage(); PizzaToppings.Add(new PizzaTopping { Name = "Green Peppers", Cost = 0.5 }); PizzaToppings.Add(new PizzaTopping { Name = "Cucumbers", Cost = 1.5 }); PizzaToppings.Add(new PizzaTopping { Name = "Pineapple", Cost = 2 }); PizzaToppings.Add(new PizzaTopping { Name = "Artichoke", Cost = 10 }); PizzaToppings.Add(new PizzaTopping { Name = "Motor Oil", IsSelected = true, Cost = 4 }); PizzaToppings.Add(new PizzaTopping { Name = "Bleach", Cost = 0 }); }