Banking System in Java
Banking System in Java
The
saving account provides compound interest and withdrawal facility. The checking account provides
cheque book facility but no interest. Checking account holders should also maintain a minimum
balance and if the balance falls below this level, a service charge is imposed. The saving account does
not have to maintain a minimum balance, but a service fee will be charged each time withdrawing
money directly from the saving account. Create a class called Account that stores customer account
number, user name, and balance (suggest to use protected for the variable balance).
Inherit the Account class into classes Cheque and Saving, respectively. In the Cheque class, declare
private static final member variables minimBalance and overLimitCharge (set to 1000 and 5
respectively). In the Saving class, declare a private static final member variable called
eachTimeCharge (set to 3.9) that stores each time withdraw service rate. Also create a bank class to
maintain the accounts, which has members bankName and an ArrayList accounts that store checking
and saving accounts. Include the necessary member functions and constructors to achieve the
following tasks:
Account(): the default constructor which generates an account number using random integer, and
initialize other member variables.
Account(String user): the overloaded constructor that takes the argument for account name and
initialize other member variables.
void display(): displays (print) the account information including user name, account number and the
balance.
• void deposit(float m): accept deposit from a customer and update the balance.
void withdraw(float m): define an abstract method that can be override by the derived class and
enable late dynamically calling corresponding member functions in the derived classes.
define a withdraw function that withdraws money according to the user request • In this function,
check if this withdraw is allowed according to the available balance and withdraw limit for each time.
• Calculate over limit service fee if the balance is lower than a limit when applying a withdraw.
define a withdraw function that withdraws money according to the user request
• In this function, check if this withdraw is allowed according to the available balance for each time.