Пример #1
0
        static void Main(string[] args)
        {
            Garden garden = new Garden();

            Flower yellowFlower = new Flower(Color.Yellow);
            Flower blueFlower   = new Flower(Color.Blue);
            Tree   purpleTree   = new Tree(Color.Purple);
            Tree   orangeTree   = new Tree(Color.Orange);

            garden.AddPlant(yellowFlower);
            garden.AddPlant(blueFlower);
            garden.AddPlant(purpleTree);
            garden.AddPlant(orangeTree);

            garden.ShowGarden();
            Console.WriteLine();
            garden.WaterPlants(40);
            Console.WriteLine();
            garden.ShowGarden();
            Console.WriteLine();
            garden.WaterPlants(70);
            Console.WriteLine();
            garden.ShowGarden();
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Garden garden = new Garden();

            garden.AddPlant(new Flower("yellow"));
            garden.AddPlant(new Flower("blue"));
            garden.AddPlant(new Tree("purple"));
            garden.AddPlant(new Tree("orange"));

            garden.ShowGarden();
            garden.WaterPlants(40);
            garden.WaterPlants(70);


            Console.ReadLine();
        }