Spring 2025 [Bono]
The goal of this lab is for you to practice more with exception handling. The lab involves enhancements to the DataAnalyzer example from Ch. 11 of the textbook and discussed in lecture.
For credit on these exercises, they must be written in the style the original program is written; for example, it uses exception handling, and all the error-reporting and recovery happens in main.
The lab files are the DataAnalyzer example from the Exceptions chapter of the textbook, and some sample input files with and without errors.
Compile and run the program with the sample data files to see how it currently behaves.
Change the program so it still prompts for a new file name if the file is not found (i.e., it still does not exit on file not found), but now it will exit the program if it found any problems with the file format. (The original version prompts for a new file name in those cases.) It would, of course, report the error to the user before exiting, as it did before.
First, an error message that does not change as a result of your work: The following message will be the same as before, and happen in the same circumstances (except the program now exits on this error, because of the change you made for Part 1):
Bad data: Length expected
Instead of the other error messages the current program produces, the
following messages will now be produced when these errors occur
Note: each one will be worth one point.
Make sure you put your name and NetID in all the files you submit. No README required for this lab.
When you click the Submit button, it will be looking for
and compiling (for source code) the files
DataAnalyzer.java,
and DataSetReader.java.