Computer Science 1260 – Classwork – Customer Files
July 12, 2017 / In class exercise / Due: ______

Purpose

The purpose of this exercise is to practice with text file input and output along with related exceptions. The context is a customer class that manages the name, ID, state, and zip code for each customer in our database. The information is maintained in a text file. The program will input the data from a text file into an ArrayList<Customer>, display it, sort it, and save it into a different text file. The project should look like this.

Note that the data files are in a subfolder of the project, but they are NOT included in the src folder.

Specifications

You are provided with a file of customer data named customer.txt. The Customer.java code file is also provided and complete. The text file may or may not contain invalid records (missing or extra fields). Part of the text file is shown here. Note that the records are delimited by the pound/hash tag (#) character.

Your task is to use the code in the screenshot below and complete the program by completing the methods invoked from the main method. The getCustomersFromFile and saveCustomers methods should use JFileChooser to allow the user to select the input file and saved file names. The dialogs should open in the Customer Data folder of the project. Use appropriate filters and methods to manage the dialogs. The saved file should NOT overwrite the original data.

Deliverables

Zip the customerFiles package and the Customer Data folders with their contents using the usual naming rules and submit as specified in the Course Facts document.

Partial Sample Output

Classwork – Customer Text File ManagementPage 1