Bank Account simulation source code in Java,
March 15, 2009 at 7:08 AM
I have to submit assignment on bank account simulation. details as below.
1. Account Class : This is an abstract class. It contains following information, - Customer Account number an integer number, This is automatically generated starting from 101. - Customer type which is of character type and can have only 2 values C or S. C for Curr-acct and S for Savings account - Customer Name. - Customer Address of String type. This class has following methods, - Constructor method to initialize all 4 variables given above - One method that displays all above information in required output format. - One abstract method defined as, float calculateBalance( ) ; This method is overridden in the two subclasses. 2. Curr-accnt class : This is one subclass of above defined Account class and stores following information, - Balance in Account. - Interest Rate. - Penalty. This class contains following methods, - Constructor. - Overridden method calculate Balance to calculate the balance in account. - Accept deposit from customer and update the balance. - Compute and deposit interest. - Withdraw and update interest. - Check for minimum balance, impose penalty if necessary and update the balance. - Method that displays the data in this class and super class in the required output format. 3. Savings-accnt class This is one subclass of above defined Account class and stores following information, - Balance in Account. - Interest Rate. This class contains following methods, - Constructor. - Overridden method calculate Balance to calculate the balance in account. - Accept deposit from customer and update the balance. - Compute and deposit interest. - Withdraw and update interest. - Method that displays the data in this class and super class in the required output format. At the end, this program should ask the user to enter the customer account number and should find out whether the particular account number is valid or not. If the customer is present then the all the information about the concerned account should be displayed . Similarly, the customer is asked whether the customer wants to deposit or withdraw the amount and accordingly proper methods are invoked. If the customer account number is not valid then proper error message should be displayed.