Exemplo n.º 1
0
        public void ImprimirMasAntiguo()
        {
            Socio socio = new Socio("", 0);

            for (int i = 0; i < Socios.GetLength(0); i++)
            {
                if (Socios[i]._Antiguedad > socio._Antiguedad)
                {
                    socio = Socios[i];
                }
            }
            Console.WriteLine("El socio mas antiguo es {0} con {1} años de antiguedad",
                              socio._Nombre, socio._Antiguedad);
        }
Exemplo n.º 2
0
        public Club()
        {
            string nombre;
            int    antiguedad;

            for (int i = 0; i < Socios.GetLength(0); i++)
            {
                Console.Write("Ingrese el nombre del socio {0}: ", i + 1);
                nombre = Console.ReadLine();
                Console.Write("Ingrese los años de antiguedad del socio {0}: ", i + 1);
                antiguedad = int.Parse(Console.ReadLine());
                Socios[i]  = new Socio(nombre, antiguedad);
            }
        }