Question: BankAccountRevised Programming Assignment Modify the BankAccount Class by creating BankAccountRevised that include the following features: 1) Change the BankAccount class so that all accounts will



BankAccountRevised Programming Assignment Modify the BankAccount Class by creating BankAccountRevised that include the following features: 1) Change the BankAccount class so that all accounts will have a monthly fee. Define the instance variable monthlyFee that holds the monthly fee? private double monthlyFee; 2) Change the BankAccount class so that all accounts will have a monthly fee. The instance variable monthlyFee will hold the monthly fee. 3) Change the BankAccount class to include a giveBonus() method as shown below 4) Change the BankAccount class. Add transfer() method to transfer a bank account from one account to another Add a Tester Class to show the output of the new methods in Revised BankAccount class Java BankAccount.java A bank account has a balance that can be changed by deposits and withdrawals. */ public class BankAccount { private double balance; Constructs a bank account with a zero balance. */ public BankAccount() { balance = 0; } Constructs a bank account with a given balance. @param initialBalance the initial balance public BankAccount (double initialBalance) { balance = initialBalance; } */ Deposits money into the bank account. @param amount the amount to deposit public void deposit(double amount) { balance = balance + amount; } Withdraws money from the bank account. @param amount the amount to withdraw */ public void withdraw(double amount) { balance = balance - amount; } /** Gets the current balance of the bank account. @return the current balance */ public double getBalance() { return balance; } } - BankAccountTester(1).java /** A class to test the BankAccount class. * public class BankAccountTester { /** Tests the methods of the BankAccount class. @param args not used */ public static void main(String[] args) { BankAccount harrysChecking new BankAccount(); harrysChecking.deposit(2000); harrysChecking.withdraw(500); = System.out.println(harrysChecking.getBalance() ); System.out.println("Expected: 1500"); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
