Question
Please help me write this Java class function. I had asked this question before, but got completey random answers that had nothing to do with
Please help me write this Java class function. I had asked this question before, but got completey random answers that had nothing to do with the question. Please provide the correct answer. If you do not know the answer, then please do not provide an incorrect answer. I only have 2 more questions remaining to ask, providing incorrect answers wastes my questions.
We are using the latest version of java. Thank You! Please provide screenshots of your code for each class and the output since it is easier to see the format that way.
public class BankDemo1 { public static void main(String[] args) { Bank csumbBank = new Bank("CSUMB"); System.out.println("========== READ DATA =========="); csumbBank.readData("C:\\tmp\\test1.txt"); System.out.println("========== DONE =========="); System.out.println(" ========== BANK INFORMATION =========="); csumbBank.bankInfo(); System.out.println(" ========== ACCOUNT INFORMATION =========="); csumbBank.accountInfo(1000); csumbBank.deposit(1000, 150.25); System.out.println(" ========== ACCOUNT INFORMATION =========="); csumbBank.accountInfo(1000); csumbBank.withdraw(1000, 100); System.out.println(" ========== ACCOUNT INFORMATION =========="); csumbBank.accountInfo(1000); System.out.println(" ========== ACCOUNT CLOSE =========="); if (csumbBank.closeAccount(1000)) { System.out.println("Account closed."); } System.out.println(" ========== TRANSACTION INFO =========="); csumbBank.transaction(1000); System.out.println(" ========== TRANSACTION INFO =========="); csumbBank.transaction(2000); } }
This is the class used to format the date and time:
import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; public class Main { 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); } }
This the output of demo 1:
public class BankDemo2 { public static void main(String[] args) { Bank csumbBank = new Bank("CSUMB"); csumbBank.readData("C:\\tmp\\test1.txt"); System.out.println("========== NEW CUSTOMERS =========="); csumbBank.newCustomer("Bob Smith", "123 University Center", 93955, "123-45-6789"); csumbBank.newCustomer("Unknown Smith", "123 University Center", 93955, "777-77-7777"); System.out.println(" ========== NEW ACCOUNTS =========="); csumbBank.newAccount("777-77-7777", 4000, 1, 100.50); csumbBank.newAccount("123-45-7777", 2000, 1, 100.50); csumbBank.newAccount("123-45-7777", 4000, 1, 100.50); System.out.println(" ========== ACCOUNT INFO =========="); csumbBank.accountInfo(7000); System.out.println(" ==== CUSTOMER WITH LAST FOUR DIGIT SSN ===="); csumbBank.customerInfoWithSSN(7979); System.out.println(" ==== CUSTOMER WITH SSN 7777 ===="); csumbBank.customerInfoWithSSN(7777); System.out.println(" ==== CUSTOMER WITH SSN 6789 ===="); csumbBank.customerInfoWithSSN(6789); // We try to close the account 2000. csumbBank.closeAccount(2000); System.out.println(" ==== REMOVE CUSTOMER: 555-55-5555 ===="); csumbBank.removeCustomer("555-55-5555"); System.out.println(" ==== REMOVE CUSTOMER: 777-77-7777 ===="); csumbBank.removeCustomer("777-77-7777"); } }you will develop four classes called Bank, Account, Customer, and Transaction to store account information, customer information, and transaction information of a bank. Based on the sample input data and sample run, you should identify operations of the project you can use either Array or ArrayList. If you use arrays, you can assume that your Bank class can have maximum 30 Accounts, 30 Customers, and 100 Transactions. Note that an Account object can have only one Customer, and each Customer can have a maximum of two Accounts (-one checking and one savings account). A Transaction object should include the account number, transaction type( deposit, withdrawal, and closing an account), and trans- action date/time information Sample Input File The following file represents a sample bank data file, c: \\tmp\\test1.txt, which is used in the sample runs below. Note that the first line (- 4) indicates the number of customers in the bank. The customer's information includes the name, address, zip code, and Social Security Number (SSN). Note that each customer data is delimited by comma symbol (). After the customer data, there is a number of accounts5 in the example). Each account in formation has SSN, account number, account type (1: checking, 2: savings), and current balance. Again, comma is used as a delimiter. 4 Tom Smith,123 University Center,93955,777-77-7777 Alice Smith,123 University Center, 93955, 888-88-8888 Joe Otter,2440 Ocean Avenue,93900,999-99-9999 Monica Smith,123 University Center, 93955,123-45-7777 777-77-7777,1000,1,10.0 888-88-8888,2000,1,50.25 777-77-7777,3000,2,100.0 999-99-9999,5000,1,100.25 888-88-8888, 6000,2,500.25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started