Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. package Finance.Bank;
  2.  
  3. public class BankAccount {
  4.  
  5. private String name;
  6. private static double interestRate = 1.5;
  7. private int days;
  8. private double balance;
  9. private double interest;
  10.  
  11. public BankAccount(String name, double amount) {
  12.  
  13. this.name = name;
  14. this.balance = amount;
  15.  
  16. }
  17.  
  18. public double deposit(double amount) {
  19.  
  20. balance = balance + amount;
  21. return balance;
  22.  
  23. }
  24.  
  25. public double Withdraw(double amount) {
  26. balance = balance - amount;
  27. return balance;
  28. }
  29.  
  30. public void displayInfo() {
  31. // TODO Auto-generated method stub
  32.  
  33. }
  34.  
  35. public static void setInterestRate(double interestRate) {
  36.  
  37. BankAccount.interestRate = interestRate;
  38. }
  39.  
  40. public double getInterestRate() {
  41.  
  42. return interestRate;
  43. }
  44.  
  45. public double calculateInterest(int days1) {
  46. // TODO Auto-generated method stub
  47.  
  48. return Math.pow(+1 * interestRate, days);
  49. }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement