static void Main(string[] args)
        {
            ICar seat  = new Seat("Leon", "Grey");
            ICar tesla = new Tesla("Model 3", "Red", 2);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }
Пример #2
0
        public static void Main()
        {
            string model = Console.ReadLine();
            string color = Console.ReadLine();
            var    seat  = new Seat(model, color);

            model = Console.ReadLine();
            color = Console.ReadLine();
            int batteries = int.Parse(Console.ReadLine());
            var tesla     = new Tesla(model, color, batteries);

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }
Пример #3
0
        public static void Main()
        {
            ICar seat = new Seat("Leon", "Grey");

            Console.WriteLine(seat.Start());
            Console.WriteLine(seat.Stop());

            ICar tesla = new Tesla("Model 3", "Red", 2);

            Console.WriteLine(tesla.Start());
            Console.WriteLine(tesla.Stop());

            Console.WriteLine(seat.ToString());
            Console.WriteLine(tesla.ToString());
        }