public Interes CrearInteres(string tipo, double valorPrestado, int tiempo, double tasa) { Interes interes; if (tipo.Equals("c")) { interes = new Compuesto(valorPrestado, tiempo, tasa); interes.CalcularValorTotal(); } else { interes = new Simple(valorPrestado, tiempo, tasa); interes.CalcularValorTotal(); } return(interes); }