コード例 #1
0
        public double Calculo(Conta conta, Investimento perfilInvestimento)
        {
            double valorInvestimento = perfilInvestimento.Calculo(conta);

            MessageBox.Show("Investimento: " + valorInvestimento);

            valorInvestimento -= perfilInvestimento.CalculaImposto(valorInvestimento);

            MessageBox.Show("Investimento sem imposto: " + valorInvestimento);

            conta.Deposita(valorInvestimento);

            return(conta.Saldo);
        }
コード例 #2
0
 public void Notificar(Investimento investimento)
 {
     Console.WriteLine("Notificando {0} que {1} " +
                       "teve preço alterado para {2:C}", Nome, investimento.Simbolo, investimento.Valor);
 }
コード例 #3
0
        public void RealizarInvestimento(Conta conta, Investimento investimento)
        {
            double resultado = investimento.CalcularInvestimento(conta);

            Console.WriteLine("INVESTIMENTO = " + resultado);
        }
コード例 #4
0
        public void Investe(Conta conta, Investimento investimento)
        {
            double retornoInvestimento = investimento.RealizaInvestimento(conta);

            conta.Saldo = retornoInvestimento * 0.75;
        }