Design a class named ‘Account’ to represent a simple bank account. The class should hold the following:-
• Fields/attributes – first name, last name, account number, balance.
• Constructors to create an Account object either with a given starting balance or an unknown starting balance in which it should be set to 0.0.
• Methods:
o all ‘getter’ & ‘setter’ methods;
o getFullName method that will return the full name of account holder.
o display method to print out the details of an Account object;
o withdraw method & deposit method – which will subtract or add an amount from the balance and output a string containing the revised balance.
Design a new class named ‘CurrentAccount’ that derives from ‘Account’ to represent a current account. The class should hold the following additions/changes:-
• Field/attribute – overdraft limit.
• Constructors to create a CurrentAccount object either with a given overdraft limit or an unknown overdraft limit in which it should be set to 0.0.
• Methods:
o ‘getter’ & ‘setter’ methods for overdraft limit;
o display method to print out the details of a CurrentAccount object;
o withdraw method – which will subtract an amount from the balance and output a string containing the revised balance. Your program should allow the withdraw method reduce a balance below zero only if the resulting balance is greater or equal to the overdraft limit. If not, an appropriate message should be output.
Design a new class named ‘SavingAccount’ that derives from ‘Account’ to represent a saving account. The class should hold the following changes:-
• Constructors to create a SavingAccount object.
• Methods:
o withdraw method – which will subtract an amount from the balance and output a string containing the revised balance. Your program should NOT allow the withdraw method reduce a balance below zero. Show an appropriate message if the case happened.
Develop a program that includes all the classes.
In main method, creates an array of 50 current accounts and another array of 50 saving accounts.
Your program should provide the functions such as:
1. Allow user to create a new current account / saving account
2. Withdraw / deposit from an account
3. Print the details of an account
4. Print the details of all accounts