Common File Errors

Goals

Reading and writing files is an error-prone activity. This lab will expose you to the most common errors so that when they happen to you (and they will!), you will be able to recognize them and know how to fix them.

Procedure

Open the FileErrors.jpr project in JBuilder. The project contains four classes that are nearly identical. Each one should read the file of baseball players you encountered in a previous lab exercise with one difference — this file has only four players. However, each file has a different error. Your task will be to find the error and fix it. This shouldn't be hard given the small size of the programs and datafile.

You will need to submit the same information for each of the four programs. For each program, choose it in the drop-down menu, fill in the other questions, and then hit the submit button.

Which program?
When you ran the program, what did it do that told you there was an error? If there was an error message, copy the most helpful part in diagnosing the error.
Describe the cause of the problem.
What did you do to fix the problem?