Пример #1
0
    public static void Main(string[] args)
    {
        IDisciplina h = new DisciplinaAnual("historia", 10, 8, 7, 4, 3, 7);
        IDisciplina f = new DisciplinaSemestral("fisica", 10, 8, 7, 4);

        Console.WriteLine(f);
        Console.WriteLine(h.CalcMediaParcial());
        Console.WriteLine(h.CalcMediaFinal());

        IDisciplina[] x = new IDisciplina[2];
        x[0] = new DisciplinaAnual("POO", 10, 10, 8, 7, 2, 9);
        x[1] = new DisciplinaSemestral("Filosofia", 10, 5, 4, 8);
        foreach (IDisciplina dd in x)
        {
            Console.WriteLine(dd.ToString());
        }

        object[] w = new object[2];
        w[0] = new DisciplinaAnual("Matemática", 10, 8, 7, 9, 7, 0);
        w[1] = new DisciplinaSemestral("SIP", 10, 8, 7, 9);
        foreach (object o in w)
        {
            Console.WriteLine($"{o.ToString()}");
        }
    }
Пример #2
0
 public static void Main(string[] args)
 {
     IDisciplina[] historico = new IDisciplina[4];
     historico[0] = new DisciplinaSemestral("Poo", 100, 100);
     historico[1] = new DisciplinaSemestral("Sistemas Digitais", 60, 60);
     historico[2] = new DisciplinaAnual("Poo2", 100, 100, 80, 60);
     historico[3] = new DisciplinaAnual("Sistemas Digitais 2", 60, 60, 50, 100);
     foreach (IDisciplina x in historico)
     {
         Console.WriteLine($"{x.GetNome()} {x.CalcMediaParcial()}");
     }
 }
Пример #3
0
    public static void Main(string[] args)
    {
        DisciplinaSemestral ds1 = new DisciplinaSemestral("POO", 100, 100, 0);

        Console.WriteLine($"{ds1.GetNome()}\t{ds1.CalcMediaParcial()}\t{ds1.CalcMediaFinal()}");
        DisciplinaSemestral ds2 = new DisciplinaSemestral("Algoritmos", 80, 40, 60);

        Console.WriteLine($"{ds2.GetNome()}\t{ds2.CalcMediaParcial()}\t{ds2.CalcMediaFinal()}");
        DisciplinaAnual da1 = new DisciplinaAnual("Programação", 70, 70, 40, 40, 0);

        Console.WriteLine($"{da1.GetNome()}\t{da1.CalcMediaParcial()}\t{da1.CalcMediaFinal()}");
        return;
    }