Example #1
0
 // Crear el nombre de dia para poder modificarlo luego
 public Dia(String n)
 {
     nombreDia     = n;
     tablaPrograma = new Programa[5];
     for (int i = 0; i < tablaPrograma.Length; i++)
     {
         tablaPrograma[i] = new Programa();
     }
 }
Example #2
0
        static void Main(string[] args)
        {
            Semana   miTV = new Semana();
            Programa miProgramaTV;

            int    opcion, duracionP, numeroDia, numeroHorario;
            string nombreP, contenidoP;

            do
            {
                opcion = menu();
                switch (opcion)
                {
                case 1:
                    Console.WriteLine("Introduce nombre Programa: ");
                    nombreP = Console.ReadLine();
                    Console.WriteLine("Introduce contenido Programa: ");
                    contenidoP = Console.ReadLine();
                    Console.WriteLine("Introduce duracion programa:");
                    duracionP = Int32.Parse(Console.ReadLine());
                    Console.WriteLine("Introduce numero dia:");
                    numeroDia = Int32.Parse(Console.ReadLine());
                    Console.WriteLine("Introduce horario:");
                    numeroHorario = Int32.Parse(Console.ReadLine());

                    miProgramaTV = new Programa(nombreP, contenidoP, duracionP);
                    miTV.SetPrograma(miProgramaTV, numeroDia, numeroHorario);
                    Console.ReadKey();
                    break;

                case 2:

                    break;

                case 3:
                    Console.WriteLine("Introduce numero dia:");
                    numeroDia = Int32.Parse(Console.ReadLine());
                    miTV.Escribir(numeroDia);
                    Console.ReadKey();
                    break;

                case 4:
                    miTV.Escribir();
                    Console.ReadKey();
                    break;

                case 5:
                    Console.WriteLine("Salir del Programa");
                    break;
                }
            } while (opcion != 5);
        }
Example #3
0
 public void SetPrograma(Programa p, int dia, int hora)
 {
     tablaDias[dia].SetPrograma(p, hora);
 }
Example #4
0
 public void SetPrograma(Programa p, int hora)
 {
     tablaPrograma[hora] = p;
 }