Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Finance.Bank;
- public class BankAccount {
- private String name;
- private static double interestRate = 0.5;
- private int days;
- private static double balance;
- public BankAccount(String name, double amount) {
- this.name = name;
- balance = amount;
- }
- public double deposit(double amount) {
- balance = balance + amount;
- return balance;
- }
- public double Withdraw(double amount) {
- balance = balance - amount;
- return balance;
- }
- public void displayInfo() {
- // TODO Auto-generated method stub
- }
- public static void setInterestRate(double interestRate) {
- balance = balance + balance * interestRate;
- }
- public static double getInterestRate() {
- return interestRate;
- }
- public double calculateInterest(int days) {
- // TODO Auto-generated method stub
- balance = Math.pow(balance * (1 + interestRate), days);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement