Ejemplo n.º 1
0
 public void takeDeposit(Client client, Deposit deposit) {
   if (clients.contains(client)) {
     if (client.openDeposit(deposit)) {
       bankProducts.add(deposit);
       reserv += deposit.getAmount() * 0.9;
       capital += deposit.getAmount();
     } else System.out.println("Client doesnt have enogh money");
   } else {
     System.out.println("This client is not a customer of this bank");
   }
 }
Ejemplo n.º 2
0
  public void giveCredit(Client client, Credit credit) {
    if (reserv - credit.getAmount() - calculateMonthlyDepositAccumulations() > 0) {
      if (client.askForCredit(credit)) {
        bankProducts.add(credit);

        reserv -= credit.getAmount();
        capital -= credit.getAmount();
      }

    } else {
      System.out.println(
          "Bank doesn't have enough money in reserve to give " + credit.getAmount() + " as credit");
    }
  }