static void Main(string[] args) { Apple apple = new Apple(false, "red"); Orange orange = new Orange(3.4f); Banana banana = new Banana(true, false, 2.5f); Grapes grapes = new Grapes(false, "green"); Fruit[] fruit = new Fruit[4] { apple, orange, banana, grapes }; FruitSalad fruitSalad = new FruitSalad(fruit); PrintAppleColor(apple); printBananaSize(banana); PrintCalories(fruitSalad); IsMyFavorite(fruitSalad); FruitSalad fruitSaladFromFun = createSalad(fruit); Console.WriteLine(fruitSalad.ToString()); Console.ReadLine(); }
private static void PrintCalories(FruitSalad fruitSalad) { Console.WriteLine($"Total Calories: {fruitSalad.GetTotalCalories()}"); }
private static void IsMyFavorite(FruitSalad fruitSalad) { Console.WriteLine($"Contain My Favorite Fruit? {fruitSalad.ContainMyFavoriteFruit()}"); }