Package src
Class RunBank
java.lang.Object
src.RunBank
Driver class containg User Interface and CSV conversion to create the bank system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Dictionary<Integer,Customer> A dictionary that maps IDs to Customer objects.protected static Dictionary<String,Customer> A dictionary that maps a combined key of first name and last name to a Customer object.static booleanA flag indicating whether the customer wants to exit the application.protected static Dictionary<Integer,Customer> protected static LoggerLogger instance for logging events within the class.static booleanA flag indicating whether the customer wants to return to the main menu.List of names to maintain the order of the users, so that when the updatingCSVFile method is invoked, it can update the CSV file based on the order they were readprotected static Stringtitles for the updated CSV file(first line) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThe entry point of the application.static booleantransferHelper(String customerName, String customerName2, int fromAccount, int toAccount, double amount) Facilitates a transfer or payment transaction between accounts by customer names and account numbers.static booleantransferHelper(String customerName, String customerName2, String fromAccount, String toAccount, double amount) Facilitates a transfer or payment transaction between accounts by customer names and account types.
-
Field Details
-
customerList
A dictionary that maps a combined key of first name and last name to a Customer object. -
accountList
A dictionary that maps IDs to Customer objects. -
IDList
-
exit
public static boolean exitA flag indicating whether the customer wants to exit the application. -
mainMenu
public static boolean mainMenuA flag indicating whether the customer wants to return to the main menu. -
names
List of names to maintain the order of the users, so that when the updatingCSVFile method is invoked, it can update the CSV file based on the order they were read -
titles
titles for the updated CSV file(first line) -
log
Logger instance for logging events within the class. This `Logger` is protected and static, allowing it to be shared across instances of this class and accessible to subclasses.
-
-
Constructor Details
-
RunBank
public RunBank()
-
-
Method Details
-
main
The entry point of the application. This method initializes the bank application, reads customer data from a CSV file, and runs the main banking loop.- Parameters:
args- Command line arguments (not used in this application).
-
transferHelper
public static boolean transferHelper(String customerName, String customerName2, String fromAccount, String toAccount, double amount) Facilitates a transfer or payment transaction between accounts by customer names and account types. This method checks if both customer names are the same. If so, it transfers funds between two accounts owned by the same customer. Otherwise, it initiates a payment from one customer to another.- Parameters:
customerName- the name of the customer initiating the transactioncustomerName2- the name of the receiving customer, or the same customer if transferring between accountsfromAccount- the type of the source account (e.g., "checking", "saving")toAccount- the type of the destination accountamount- the amount to be transferred or paid- Returns:
- true if the transaction is successful; false otherwise
-
transferHelper
public static boolean transferHelper(String customerName, String customerName2, int fromAccount, int toAccount, double amount) Facilitates a transfer or payment transaction between accounts by customer names and account numbers. This method checks if both customer names are the same. If so, it transfers funds between two accounts owned by the same customer. Otherwise, it initiates a payment from one customer to another.- Parameters:
customerName- the name of the customer initiating the transactioncustomerName2- the name of the receiving customer, or the same customer if transferring between accountsfromAccount- the account number of the source accounttoAccount- the account number of the destination accountamount- the amount to be transferred or paid- Returns:
- true if the transaction is successful; false otherwise
-