Example #1
0
        public Interes CrearInteres()
        {
            string          tipo            = ObtenerTipoDeInteres("digite tipo de interes -> s para simple y -> c para compuesto : ");
            double          valorPrestado   = Convert.ToDouble(lectura.LeerNumerico("Valor Prestado : "));
            int             tiempo          = Convert.ToInt32(lectura.LeerNumerico("digite el tiempo de pago (Años): "));
            double          tasa            = Convert.ToDouble(lectura.Leer("digite la tasa de interes en porcentaje (%) solo valores enteros  :"));
            InteresFactoria interesFactoria = new InteresFactoria();
            Interes         interes         = interesFactoria.CrearInteres(tipo, valorPrestado, tiempo, tasa);

            interes.CalcularValorTotal();
            return(interes);
        }
Example #2
0
        public Credito ObtenerCreditoModificado(Credito credito)
        {
            double          valorPrestado   = float.Parse(lectura.LeerNumerico("Digite El Nuevo Valor valor del credito a prestar : "));
            int             tiempo          = Convert.ToInt32(lectura.LeerNumerico("digite el nuevo tiempo de pago (Años): "));
            double          tasa            = Convert.ToDouble(lectura.Leer("digite la nueva tasa de interes en porcentaje (%) solo valores enteros  :"));
            string          tipo            = credito.Interes.Tipo;
            InteresFactoria interesFactoria = new InteresFactoria();
            Interes         interes         = interesFactoria.CrearInteres(tipo, valorPrestado, tiempo, tasa);
            string          identificaion   = credito.Identificacion;
            Credito         creditoAuxiliar = new Credito(identificaion, credito.Cliente, interes);

            creditoAuxiliar.ValorTotal = interes.ValorInteres;
            return(creditoAuxiliar);
        }