In this project, you will enhance the Bank Account class and see how abstraction and encapsulation enable
Question:
In this project, you will enhance the Bank Account class and see how abstraction and encapsulation enable evolutionary changes to software. Begin with a simple enhancement: charging a fee for every deposit and withdrawal. Supply a mechanism for setting the fee and modify the deposit and withdraw methods so that the fee is levied. Test your class and check that the fee is computed correctly. Now make a more complex change. The bank will allow a fixed number of free transactions (deposits or withdrawals) every month, and charge for transactions exceeding the free allotment. The charge is not levied immediately but at the end of the month. Supply a new method deduct Monthly Charge to the Bank Account class that deducts the monthly charge and resets the transaction count. (Use Math.max(actual transaction count, free transaction count) in your computation.) Produce a test program that verifies that the fees are calculated correctly over several months.
Step by Step Answer: