| Код | public class Fruit { public decimal Weigh { get; set; } public string Color { get; set; } public ShapeType Shape { get; set; } }
|
| Код | public class Orange : Fruit { public decimal Radius { get; set; } }
|
| Код | public class Banana : Fruit { public decimal Length { get; set; } }
|
| Код | public enum ShapeType { Oval, Krug, }
|
| Код | public class Program { public static void Main(string[] args) { Fruit orange = new Orange { Color = "orange", Radius = 5, Weigh = 2, Shape = ShapeType.Оval }; Fruit banana = new Banana { Color = "yellow", Length = 10, Weigh = 6, Shape = ShapeType.Oval };
UpdateFruit(orange); UpdateFruit(banana); Console.ReadKey(); }
private static void UpdateFruit(Fruit fruit) { вот тут я не наю что нужно написать :dash1 }
|
|