Пример #1
0
        public static void Main(string[] args)
        {
            Console.Title = "Ejercicio 35";
            DirectorTecnico dt1 = new DirectorTecnico("Jose", new DateTime(1996, 2, 2));
            DirectorTecnico dt2 = new DirectorTecnico("Jose", new DateTime(1996, 2, 2));

            if (dt1 == dt2)
            {
                Console.WriteLine("Iguales");
            }
            Jugador j1 = new Jugador(3948954, "Juan", 10, 5);

            Console.WriteLine(j1.MostrarDatos());
            Console.WriteLine(dt1.MostrarDatos());
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.Yellow;
            int  i;
            bool a;
            //Instancio Equipo
            Equipo xTeam = new Equipo(11, "Boca Juniors");

            //Instancio Jugadores
            Jugador j1  = new Jugador(27787032, "Oscar Cordoba", 200, 5);
            Jugador j2  = new Jugador(30009216, "Hugo Ibarra", 150, 30);
            Jugador j3  = new Jugador(11396335, "Jorge Bermudez", 210, 10);
            Jugador j4  = new Jugador(11392335, "Walter Samuel", 190, 10);
            Jugador j5  = new Jugador(11396995, "JRodolfo arruabarrena", 140, 10);
            Jugador j6  = new Jugador(30089216, "Sebastian Battaglia", 190, 30);
            Jugador j7  = new Jugador(53717378, "Mauricio Serna", 200, 7);
            Jugador j8  = new Jugador(30039216, "Diego Cagna", 200, 205);
            Jugador j9  = new Jugador(27783032, "Juan Roman Riquelme", 200, 130);
            Jugador j10 = new Jugador(29747606, "Guillermo B. Schelotto", 210, 170);
            Jugador j11 = new Jugador(30409216, "Martin Palermo", 200, 230);

            //Instancio DT
            DirectorTecnico dt = new DirectorTecnico(14236517, "Carlos Bianchi", DateTime.Parse("26/04/1949"));

            a = xTeam + j1;
            a = xTeam + j2;
            a = xTeam + j3;
            a = xTeam + j4;
            a = xTeam + j5;
            a = xTeam + j6;
            a = xTeam + j7;
            a = xTeam + j8;
            a = xTeam + j9;
            a = xTeam + j10;
            a = xTeam + j11;

            Console.WriteLine("Club Atlético Boca Juniors!!\n");
            foreach (Jugador j in xTeam.jugadores)
            {
                Console.WriteLine(j.MostrarDatos());
            }

            Console.WriteLine("DT: " + dt.MostrarDatos());
            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            string encabezado;

            Equipo          equipoNuevo = new Equipo(2, "Boca");
            Jugador         jugadorUno  = new Jugador(34224440, "Juan", 20, 15);
            Jugador         jugadorDos  = new Jugador(34342343, "Pedro", 2, 30);
            Jugador         jugadorTres = new Jugador(43244356, "Lucas", 0, 12);
            DirectorTecnico nuevodt     = new DirectorTecnico("Carlos", DateTime.Parse("15/02/1950"));

            encabezado = String.Format("    {0,-10} {1,-10} {2,-10}   {3,-10} {4,10}",
                                       "DNI", "NOMBRE", "PARTIDOS", "GOLES", "PROMEDIO DE GOL");
            Console.WriteLine(encabezado);
            Console.WriteLine(jugadorUno.MostrarDatos());
            Console.WriteLine(nuevodt.MostrarDatos());

            if (jugadorUno != jugadorTres)
            {
                Console.WriteLine("\nSon distintos");
            }

            if (equipoNuevo + jugadorUno)
            {
                Console.WriteLine("Agrego jugador");
            }
            if (equipoNuevo + jugadorDos)
            {
                Console.WriteLine("Agrego jugador");
            }

            if (equipoNuevo + jugadorTres)
            {
                Console.WriteLine("Agrego jugador");
            }
            else
            {
                Console.WriteLine("No hay espacio");
            }


            Console.ReadKey();
        }
Пример #4
0
        static void Main(string[] args)
        {
            Console.Title           = "Ejercicio_35";
            Console.ForegroundColor = ConsoleColor.Green;

            DateTime nac = new DateTime(1988, 12, 02);

            Equipo          equipo1 = new Equipo(11, "rojo");
            Jugador         j1      = new Jugador(1111, "sergio", 6, 30);
            DirectorTecnico dt1     = new DirectorTecnico("Gallardo", nac, 151515);


            if (equipo1 + j1)
            {
                Console.WriteLine("Se cargo el jugador");
                Console.WriteLine(j1.MostrarDatos());
                Console.WriteLine(dt1.MostrarDatos());
            }
            Console.ReadKey();
        }
Пример #5
0
        static void Main(string[] args)
        {
            Jugador j1 = new Jugador("primero", 1, 1);
            Jugador j2 = new Jugador("segundo", 0, 0);
            Jugador j3 = new Jugador("tercero", 5, 15);
            Jugador j4 = new Jugador("cuarto", 10, 100);
            Jugador j5 = new Jugador("quinto", 0, 5);

            j1.Dni = 1;
            j2.Dni = 2;
            j3.Dni = 3;
            j4.Dni = 1;
            j5.Dni = 5;

            DirectorTecnico dt = new DirectorTecnico("DT");

            dt.Dni = 6;

            Equipo e = new Equipo(4, "equipo", dt);

            bool b1 = e + j1;
            bool b2 = e + j2;
            bool b3 = e + j3;
            bool b4 = e + j4;
            bool b5 = e + j5;

            Console.WriteLine(b1 && b2 && b3 && b4); // True.
            Console.WriteLine(b5);                   // False.
            Console.WriteLine(j1 == j4);             // True.
            Console.WriteLine(j1 == j2);             // False.

            Console.WriteLine(j4.PromedioDeGol);
            Console.WriteLine(j4.MostrarDatos());
            Console.WriteLine(dt.MostrarDatos());

            Console.Read();
        }