Question: **MUST BE IN JAVA** In this project, you will develop four classes called Bank, Account, Customer, and Transaction to store account information, customer information, and
**MUST BE IN JAVA** In this project, you will develop four classes called Bank, Account, Customer, and Transaction to store account information, customer information, and transaction information for a bank. Based on the sample input data and sample run, you should identify operations of the project. For the project, you will use ArrayList. If you would like to provide sizes (e.g., to improve efficiency), you can assume that your Bank class will have a maximum 30 accounts, 30 customers, and 100 transactions. Each Customer can have a maximum of two Accounts (= one checking and one savings account) and accounts cannot be shared between customers. A Transaction object should include the account number, transaction type (= deposit, withdrawal, closing an account), and transaction date/time information.
Time stamp code:
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| public class CurrentDateTimeExample { | |
| public static void main(String[] args) { | |
| LocalDateTime now = LocalDateTime.now(); | |
| DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd, HH:mm:ss"); | |
| String formatDateTime = now.format(formatter); | |
| System.out.println(formatDateTime); | |
| } | |
| } |
//----------------------------------------------------------------------------------------------------------//
**Sample Demo Program 1**
public class BankDemo1 { public static void main(String[] args) { Bank ClarkAtlantaUniversityBank = new Bank("ClarkAtlantaUniversity"); System.out.println("========== READ DATA =========="); ClarkAtlantaUniversityBank.readData("resources/test1.txt"); System.out.println("========== DONE =========="); System.out.println(" ========== BANK INFORMATION =========="); ClarkAtlantaUniversityBank.bankInfo(); System.out.println(" ========== ACCOUNT INFORMATION =========="); ClarkAtlantaUniversity.accountInfo(1000); ClarkAtlantaUniversity.deposit(1000, 150.25); System.out.println(" ========== ACCOUNT INFORMATION =========="); ClarkAtlantaUniversity.accountInfo(1000); ClarkAtlantaUniversity.withdraw(1000, 100); System.out.println(" ========== ACCOUNT INFORMATION =========="); ClarkAtlantaUniversity.accountInfo(1000); System.out.println(" ========== ACCOUNT CLOSE =========="); if (ClarkAtlantaUniversity.closeAccount(1000)) { System.out.println("Account closed."); } System.out.println(" ========== TRANSACTION INFO =========="); ClarkAtlantaUniversity.transaction(1000); System.out.println(" ========== TRANSACTION INFO =========="); ClarkAtlantaUniversity.transaction(2000); } } The following presents a sample execution result. For the sample run, we assume that the deposit of the account number 1000 happened on September 22, 2020. The exact time is 15:23:25 (=HH:MM:SS format). When you run the demo program, your program should get the date and time of the deposit() method execution time. In the example below, the withdraw() and closeAccount() methods were invoked at 2020-09-22 (=YYY-MM-DD), at 15:23:26 and 15:23:28, respectively.
//-----------------------------------------------------------------------------------------------------------------------//
Sample Demo Program 2 This is another sample program called BankDemo2.java (found here). public class BankDemo2 { public static void main(String[] args) { Bank ClarkAtlantaUniversityBank= new Bank("ClarkAtlantaUniversity"); ClarkAtlantaUniversityBank.readData("resources/test1.txt"); System.out.println("========== NEW CUSTOMERS =========="); ClarkAtlantaUniversityBank.newCustomer("Bob Smith", "123 University Center", 93955, "123-45-6789"); ClarkAtlantaUniversityBank.newCustomer("Unknown Smith", "123 University Center", 93955, "777-77-7777"); System.out.println(" ========== NEW ACCOUNTS =========="); ClarkAtlantaUniversityBank.newAccount("777-77-7777", 4000, 1, 100.50); ClarkAtlantaUniversityBank.newAccount("123-45-7777", 2000, 1, 100.50); ClarkAtlantaUniversityBank.newAccount("123-45-7777", 4000, 1, 100.50); System.out.println(" ========== ACCOUNT INFO =========="); ClarkAtlantaUniversityBank.accountInfo(7000); System.out.println(" ==== CUSTOMER WITH LAST FOUR DIGIT SSN ===="); ClarkAtlantaUniversityBank.customerInfoWithSSN(7979); System.out.println(" ==== CUSTOMER WITH SSN 7777 ===="); ClarkAtlantaUniversityBank.customerInfoWithSSN(7777); System.out.println(" ==== CUSTOMER WITH SSN 6789 ===="); ClarkAtlantaUniversityBank.customerInfoWithSSN(6789); // We try to close the account 2000. ClarkAtlantaUniversityBank.closeAccount(2000); System.out.println(" ==== REMOVE CUSTOMER: 555-55-5555 ===="); ClarkAtlantaUniversityBank.removeCustomer("555-55-5555"); System.out.println(" ==== REMOVE CUSTOMER: 777-77-7777 ===="); ClarkAtlantaUniversityBank.removeCustomer("777-77-7777"); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
