Exemplo n.º 1
0
 public Automovil(Automovil CarToCopy)
 {
     Init();
     this.Rendimiento = CarToCopy.Rendimiento;
     this.Contenido   = CarToCopy.Contenido;
     this.Capacidad   = CarToCopy.Capacidad;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Moto      moto   = new Moto(2, 0, Colores.Azul, 5000);
            Camion    camion = new Camion(8, 2, Colores.Negro, 6, 2);
            Automovil auto   = new Automovil(4, 2, Colores.Gris, 6, 5);

            Console.WriteLine("{0} {1} {2} {3}", moto.cantidadRuedas, moto.cantidadPuertas, moto.color, moto.cilindrada);
            Console.WriteLine("{0} {1} {2} {3} {4}", camion.cantidadRuedas, camion.cantidadPuertas, camion.color, camion.cantidadMarchas, camion.cantidadPasajeros);
            Console.WriteLine("{0} {1} {2} {3} {4}", auto.cantidadRuedas, auto.cantidadPuertas, auto.color, auto.cantidadMarchas, auto.cantidadPasajeros);
            Console.Read();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Camion    c = new Camion(18, 2, Color.Rojo, 5, 1500);
            Automovil a = new Automovil(4, 4, Color.Negro, 5, 5);
            Moto      m = new Moto(2, 0, Color.Blanco, 150);

            Console.WriteLine("Camion: " + c.CantidadRuedas.ToString() + c.CantidadPuertas.ToString() + c.Color.ToString() + c.CantidadMarchas.ToString() + c.PesoCarga.ToString());
            Console.WriteLine("Auto: " + a.CantidadRuedas.ToString() + a.CantidadPuertas.ToString() + a.Color.ToString() + a.CantidadPasajeros.ToString() + a.CantidadMarchas.ToString());
            Console.WriteLine("Moto: " + m.CantidadRuedas.ToString() + m.CantidadPuertas.ToString() + m.Color.ToString() + m.Cilindrada.ToString());

            Console.Read();
        }