public static void CalculaInvestimento(Conta conta, IInvestidor investidor)
        {
            Console.WriteLine("Saldo atual: " + conta.Saldo);
            double jurosInvestimento = investidor.Calcula(conta.Saldo);

            conta.Deposita(jurosInvestimento * 0.75);
            Console.WriteLine("Novo saldo: " + conta.Saldo);
        }
Exemplo n.º 2
0
 public void RemoverInsricao(IInvestidor observer)
 {
     _observers.Remove(observer);
 }
Exemplo n.º 3
0
 public void AdicionarInscricao(IInvestidor observer)
 {
     _observers.Add(observer);
 }
 //detach
 public void RemoverDoCadastro(IInvestidor investidor)
 {
   _investidores.Remove(investidor);
 }
 //attach
 public void Cadastrar(IInvestidor investidor)
 {
   _investidores.Add(investidor);
 }
Exemplo n.º 6
0
 public void RemoverDoCadastro(IInvestidor investidor)
 {
     _investidores.Remove(investidor);
 }
Exemplo n.º 7
0
 public void Cadastrar(IInvestidor investidor)
 {
     _investidores.Add(investidor);
 }