示例#1
0
        public static void pluss()
        {
            Console.WriteLine("\nСоздайте собственный экземпляр класса");
            Plants n = new Plants();

            Console.Write("\nВведите тип растения: ");
            n.tip = Convert.ToString(Console.ReadLine());

            Console.Write("\nВведите длину растения: ");
            n.dlina = Convert.ToDouble(Console.ReadLine());

            Console.Write("\nВведите возраст растения: ");
            n.vozrast = Convert.ToInt32(Console.ReadLine());

            Console.Write("\nВведите цвет растения: ");
            n.color = Convert.ToString(Console.ReadLine());

            Console.WriteLine("\nДержите ваш экземпляр класса\n");

            n.get_inf();

            Console.WriteLine("\nОтлично, вы справились. Нажмите Enter для выхода");
        }
示例#2
0
        static void Main(string[] args)
        {
            Plants.Description();

            Plants romashka = new Plants("flower", 12.3, 4);

            //romashka.sett("flower", 12.3, 4);

            romashka.get_inf();

            Plants tomat = new Plants();

            tomat.sett("vegetable", 8, 2, "red");
            tomat.get_inf();

            Trees bereza = new Trees(30, 50, true);

            bereza.get_inf();

            Plants.pluss();

            Console.ReadKey();
        }