static void Main(string[] args)
        {
            Investimento investi = new Investimento();

            Console.WriteLine("Qual o valor que deseja investir? \n");
            investi.valorInvestimento = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("Qual a taxa de juros do investimento? \n");
            investi.taxaJuros = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("Quatos meses deseja investir? \n");
            investi.qtdMes = Convert.ToInt32(Console.ReadLine());

            investi.RendaFixa(investi);

            Console.ReadKey();
        }
Beispiel #2
0
        public void RendaFixa(Investimento investimento)
        {
            investimento.valorTotal = valorInvestimento;

            for (int i = 1; i <= investimento.qtdMes; i++)
            {
                investimento.jurosMensal = (investimento.valorTotal * investimento.taxaJuros) / 100;

                Console.WriteLine("No mês " + i + " O rendimento é de " + investimento.jurosMensal.ToString("0.##"));

                investimento.valorTotal += Convert.ToDouble(investimento.jurosMensal.ToString("0.##"));
            }
            Console.WriteLine("O investimento Total da aplicação sem IR é: " + investimento.valorTotal);

            this.ImpostoDeRenda(investimento);

            Console.WriteLine("O investimento Total da aplicação com IR é: " + investimento.valorComIR);
        }
Beispiel #3
0
        private void ImpostoDeRenda(Investimento invest)
        {
            var imp = invest.valorTotal - invest.valorInvestimento;

            if (invest.qtdMes > 0 && invest.qtdMes <= 12)
            {
                invest.valorComIR = valorTotal - Convert.ToDouble((imp * 0.24).ToString("0.##"));
            }
            else if (invest.qtdMes > 12 && invest.qtdMes <= 24)
            {
                invest.valorComIR = valorTotal - Convert.ToDouble((imp * 0.15).ToString("0.##"));
            }
            else if (invest.qtdMes > 24 && invest.qtdMes <= 36)
            {
                invest.valorComIR = valorTotal - Convert.ToDouble((imp * 0.05).ToString("0.##"));
            }
            else
            {
                invest.valorComIR = valorTotal - Convert.ToDouble((imp * 0.01).ToString("0.##"));
            }
        }