public class matematica:notas
this.res = this.p1 + this.p2 + this.l1;
public class portugues:notas
this.res = this.p1 + this.p2 + this.l1 + this.ex1;
public static void Main()
Console.WriteLine("Criar Média final");
Console.WriteLine("Qual Matéria deseja calcular a média?");
string tipo = Console.ReadLine();
if (tipo == "matematica")
matematica not = new matematica();
Console.WriteLine("ENTRE COM A NOTA DA P1 ....:");
float p1 = float.Parse(Console.ReadLine());
Console.WriteLine("ENTRE COM A NOTA DA P2...:");
float p2 = float.Parse(Console.ReadLine());
Console.WriteLine("ENTRE COM A NOTA DA LISTA...:");
float l1 = float.Parse(Console.ReadLine());
Console.WriteLine("MÉDIA FINAL =" ());
portugues not = new portugues();
Console.WriteLine("ENTRE COM A NOTA DA P1 ....:");
float p1 = float.Parse(Console.ReadLine());
Console.WriteLine("ENTRE COM A NOTA DA P2...:");
float p2 = float.Parse(Console.ReadLine());
Console.WriteLine("ENTRE COM A NOTA DA LISTA...:");
float l1 = float.Parse(Console.ReadLine());
Console.WriteLine("ENTRE COM A NOTA DO EXERCICIO...:");
float ex1 = float.Parse(Console.ReadLine());
Console.WriteLine("MÉDIA FINAL =" ());