Question: You have been asked to write a program for a bank. Your main entity is the bank account which has the following characteristics: It holds
You have been asked to write a program for a bank. Your main entity is the bank account which has the following characteristics: It holds the customer information (national ID, name, address, email, mobile numberetc) It holds the current balance. For simplicity, we will not record the previous transactions. The user can perform 7 operations: Create a new account Deposit: add an amount of money to the balance. Withdrawal: withdraw an amount of money from the balance if there is sufficient amount in the current balance. Check balance: print the current balance on the screen. Get a new loan: The customer can have also a loan so the system should keep track of the following: Does the customer have a loan? How much is the loan? The loan period in years (e.g. rate = 5 years). What is the interest rate on this loan? o Interest = loan * (rate/100) How much the customer should pay in total and monthly which we will calculate as follow: o Total payable amount = loan + interest o The monthly payment = Total payable amount / (number of years * 12) The remaining amount to be paid, which should be updated with each new payment. When a customer gets a loan, the loan amount should be added to his current balance. For simplicity we will not keep track of the payments dates and will not examine to see if a customer is late on his payments. Also for simplicity the customer can get a new loan if he does not have any remaining balance to be paid from a previous loan. Check loan: print the status of the current loan (if exist) on the screen Pay for a loan: the customer can pay only the monthly amount due. Finally, you should create a Bank class that contains the main method with the following: It must print a selection screen were the user can choose the operation he/she wants to perform: Create a new account. Deposit an amount on an existing account. Withdrawal an amount from an existing account. Check the current balance of an existing account. Get a new loan on an existing account. Check an existing loan status (the amount, the remaining balance, the monthly payments etc). Pay for the monthly payment for an existing loan. List the names and the account numbers for all customers of the bank in alphabetical order. When a user choses the operation he would like to perform he will be asked for the appropriate information (such as the account number) For example the main screen should look something like this:
The user must be able to create several accounts at one session and they must be stored in an ArrayList. Each class (apart from the main class) must override the methods toString and equals from class Object. In your solution, you must use at least 3 classes and you should utilize (use) the following concepts: Inheritance. Interface or abstract class. Your submitted program must be working correctly and satisfy all these requirements in order to receive a good mark.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
