public static void Main(string[] args) { Restaurant restaurant = new Restaurant("Casa Domingo"); Vegetable tomato = new Vegetable("Tomato", 20); Vegetable cucumber = new Vegetable("Cucumber", 15); Salad salad = new Salad("Tomatoes with cucumbers"); salad.Add(tomato); salad.Add(cucumber); Console.WriteLine(salad.GetTotalCalories()); Console.WriteLine(salad.GetProductCount()); Console.WriteLine(salad.ToString()); restaurant.Add(salad); Console.WriteLine(restaurant.Buy("Invalid salad")); Vegetable corn = new Vegetable("Corn", 90); Salad casaDomingo = new Salad("Casa Domingo"); casaDomingo.Add(tomato); casaDomingo.Add(cucumber); casaDomingo.Add(corn); restaurant.Add(casaDomingo); Console.WriteLine(restaurant.GetHealthiestSalad()); Console.WriteLine(restaurant.GenerateMenu()); }
public static void Main(string[] args) { Vegetable tomato = new Vegetable("tomato", 70); Vegetable cucumber = new Vegetable("cucumber", 80); Vegetable carrot = new Vegetable("carrot", 120); Vegetable potato = new Vegetable("potato", 140); Vegetable corn = new Vegetable("corn", 60); Salad Shopska = new Salad("Shopska"); Shopska.Add(tomato); Shopska.Add(cucumber); Shopska.Add(carrot); Salad Selska = new Salad("Selska"); Selska.Add(potato); Selska.Add(corn); Selska.Add(potato); Restaurant myRestaurant = new Restaurant("MyRestaurant"); myRestaurant.Add(Shopska); myRestaurant.Add(Selska); Console.WriteLine(myRestaurant.Buy("Shopska")); }
public static void Main(string[] args) { // Initialize the repository Restaurant restaurant = new Restaurant("Casa Domingo"); // Initialize the entities Vegetable tomato = new Vegetable("Tomato", 20); Vegetable cucumber = new Vegetable("Cucumber", 15); Salad salad = new Salad("Tomatoes with cucumbers"); salad.Add(tomato); salad.Add(cucumber); Console.WriteLine(salad.GetTotalCalories()); // 35 Console.WriteLine(salad.GetProductCount()); // 2 Console.WriteLine(salad.ToString()); // * Salad Tomatoes with cucumbers is 35 calories and have 2 products: // - Tomato have 20 calories // - Cucumber have 15 calories restaurant.Add(salad); Console.WriteLine(restaurant.Buy("Invalid salad")); // False // Initialize the second entities Vegetable corn = new Vegetable("Corn", 90); Salad casaDomingo = new Salad("Casa Domingo"); casaDomingo.Add(tomato); casaDomingo.Add(cucumber); casaDomingo.Add(corn); restaurant.Add(casaDomingo); Console.WriteLine(restaurant.GetHealthiestSalad()); // Tomatoes with cucumbers Console.WriteLine(); Console.WriteLine(); Console.WriteLine(restaurant.GenerateMenu()); // Casa Domingo have 2 salads: // * Salad Tomatoes with cucumbers is 35 calories and have 2 products: // - Tomato have 20 calories // - Cucumber have 15 calories // * Salad Casa Domingo is 125 calories and have 3 products: // - Tomato have 20 calories // - Cucumber have 15 calories // - Corn have 90 calories }