Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. private int id;
  2. private double balance;
  3. private static double interestRate = DEFAULT_INTEREST_RATE;
  4. private static int bankAccount = 1;
  5. ArrayList idUsers = new ArrayList();
  6. BankAccount(){
  7. this.id = bankAccount++;
  8. }
  9. static void setInterestRate(double interestRate)
  10. {
  11. BankAccount.interestRate = interestRate;
  12. }
  13. void deposit(double amount)
  14. {
  15. this.balance += amount;
  16. }
  17. double getInterest (int years)
  18. {
  19. return BankAccount.interestRate * years * this.balance;
  20. }
  21. void setIdUsers()
  22. {
  23. this.idUsers.add("Id"+ id);
  24. }
  25.  
  26.  
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement