Question: java Each customer is formatted as followed: customer id, account id, name, street_number street_name, city, state, zip_code, ssn, balance_in_account Remember that the account and customer

java

java Each customer is formatted as followed: customer id, account id, name,street_number street_name, city, state, zip_code, ssn, balance_in_account Remember that the account and

Each customer is formatted as followed: customer id, account id, name, street_number street_name, city, state, zip_code, ssn, balance_in_account

Remember that the account and customer ids are auto-generated. You should discard the first two ids when you create new Account objects.

accounts.txt:

1010, 1001, Sarah Williams, 2000 Main Street, Santa Monica, FL, 30309, 123-45-6789, 9099.03

1310, 1004, Alex Brown, 400 South Johnsville Road, New Lebanon, OH, 45345, 987-65-4321, 0.03

1450, 1003, Will Deaton, 523 Help Street, Seattle, WS, 73926, 861-40-8943, 4627.98

2200, 1006, Ash Brown, 600 That Street, Lexington, KY, 93658, 123-15-6789, 14.34

1990, 1007, Svetlana Kolobanova, 700 This Street, Harrisburg, PA, 01836, 143-45-6789, 13413.43

1720, 10010, Vald Putin, 800 That Other Street, Altoona, PA, 02846, 123-45-7789, 12470.93

9850, 1002, Ben Hem, 123 Plain Road, Las Vegas, NA, 90587, 123-45-6787, 9352.65

2140, 10053, Andy Wade Williams, 678 Sulphur Springs, Huston, TX, 19472, 125-45-6789, 1347829.09

52350, 10067, John Williams, 69 Nice Road, Austin, TX, 91248, 123-45-6319, 134.31

5230, 10078, Bob Grey, 875 New Street, Columbus, OH, 49024, 123-45-6723, 0.0

Class Project2Driver: The Project2Driver class should contain the following methods: . public static Account[] readAccounts FromFile(String fileName) - This method reads in all accounts information from the file name accounts.txt and returns an array of Account objects. The method returns null if there is no information in the file. We assume the file contains information for 10 accounts. The account information is stored as a String in the text file. Each line has the information of a single account in the following format. 1030, 1003, John Connor, 2000 Main Street, Santa Monica, FL, 30309, 123-45-6789, 9099.05. Remember that the account and customer ids are auto generated. You should discard the first two ids when you create new Account objects. Hint: you can use the split method from the String class to separate the single account information using commas as the split delimiter. public static boolean writeAccountsToFile(Account[] accounts, String filename) - This method writes the information from the accounts array to the file as text. Returns false if it fails to write to the file and true, otherwise. public static void main(String[] args) This is the main method that will run your program. You are to test the readAccountsFromFile() and write AccountsToFile() methods here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!