Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I really need some help with the following assignment. I uploaded the starting files here: http://s000.tinyupload.com/index.php?file_id=08703520709618323684 I'm having a hard time with the last part
I really need some help with the following assignment.
I uploaded the starting files here: http://s000.tinyupload.com/index.php?file_id=08703520709618323684
I'm having a hard time with the last part of the assignment: "Modify the CustomerManagerApp class so it handles all exceptions appropriately."
If someone could point me in the right direction, I would appreciate it. Thanks a lot!
Chapter 16 Project: Customer Manager Improve the exception handling for an application that manages customer data. Console for a FileNotFoundException Welcome to the Customer Manager Error reading data file! Exiting application. java.io.FileNotFoundException: customers.txt (The system cannot find the file specified) Console for an IOException Welcome to the Customer Manager COMMAND MENU list add del help exit - List all customers -Add a customer - Delete a customer -Show this menu - Exit this application Enter a command: add Enter first name: John Enter last name: Doe Enter customer email: johndoe@x.com Error adding customer. Try again. Enter a command: Specifications . Your instructor should provide you with a starting project for a Customer Manager application that allows you to add and delete customer records. This source code should be the same as the solution for exercise 15-1 in the book Modify the CustomerTextFile class so it throws all exceptions to the calling class. To get this to work, you'll need to modify the DAO interface so each of its methods throws the IOException. .Modify the CustomerManager App class so it handles all exceptions appropriately . If the application can't find the file that stores the data, display an error message and exit the application. To cause a FileNotFoundException, you can move or rename the data file If the application can't add or delete a record, display an error message and allow the user to try again. To simulate an IOException, you can add a statement to the CustomerTextFile class that throws an IOException. . Chapter 16 Project: Customer Manager Improve the exception handling for an application that manages customer data. Console for a FileNotFoundException Welcome to the Customer Manager Error reading data file! Exiting application. java.io.FileNotFoundException: customers.txt (The system cannot find the file specified) Console for an IOException Welcome to the Customer Manager COMMAND MENU list add del help exit - List all customers -Add a customer - Delete a customer -Show this menu - Exit this application Enter a command: add Enter first name: John Enter last name: Doe Enter customer email: johndoe@x.com Error adding customer. Try again. Enter a command: Specifications . Your instructor should provide you with a starting project for a Customer Manager application that allows you to add and delete customer records. This source code should be the same as the solution for exercise 15-1 in the book Modify the CustomerTextFile class so it throws all exceptions to the calling class. To get this to work, you'll need to modify the DAO interface so each of its methods throws the IOException. .Modify the CustomerManager App class so it handles all exceptions appropriately . If the application can't find the file that stores the data, display an error message and exit the application. To cause a FileNotFoundException, you can move or rename the data file If the application can't add or delete a record, display an error message and allow the user to try again. To simulate an IOException, you can add a statement to the CustomerTextFile class that throws an IOExceptionStep 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