public void evaluateCredit( Client client, double creditMoney, Credit.CreditType creditType, int period) { double allMonthlyPayments = 0; for (Credit credits : client.getCredits()) { allMonthlyPayments += credits.getMonthlyPayment(); } if (allMonthlyPayments < client.getSalary() / 2) { if (this.reserve - creditMoney > this.getAllDepositMoney() * 0.1) { this.createCredit(client, creditMoney, creditType, period); System.out.println(this.name + " gave " + client.getName() + " a credit of " + creditMoney); this.allDepositMoney -= creditMoney; } else { System.out.println("The bank cannot afford to give this credit."); } } else { System.out.println(client.getName() + " cannot afford to pay this credit."); } }