Java

Exceptions Program

8 points

In this program, you'll practice working with some of the key concepts from Chapter 11 on exceptions. The Java file you'll want to download is: ExceptionsHomework.java. You can download it and create a NetBeans project with it as the existing Java file.

Once the NetBeans project exists, you can download: artists.txt, which is an input file. It can be downloaded to the 'test' folder inside the newly-created NetBeans project.

The Java file has instructions on how to complete the program.

Once you have finished writing the program, run it. When the program asks for the input file, enter 'test/artists.txt'.

Once your program is working, test out your exception handling. Try misspelling the name of the input file. Try adding errors to the input file to see if your exception handling is working. Try changing the first line of artists.txt to a String. Try deleting a performer's name. Try deleting a price. None of these changes should cause your program to crash.

 

Demo
Here is a zipped-up JAR file for the completed program. Right-click on the link to download the file to the root (H:, the top level) of your server space. Double-click the downloaded file to extract ExceptionsHomework.jar, artists.txt and EH.bat. Then run the program by double-clicking on EH.bat.