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()}"); } }
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; }