Write a program similar to the one in Listing 10.10 that can write an arbitrary number of Species objects to a binary file. (Species appears in Listing 5.19 of Chapter 5.) Read the file name and the data for the objects from a text file that you create by using a text editor. Then write another program that can search a binary file created by your first program and show the user the data for any requested endangered species. The user gives the file name and then enters the name of the species. The program either displays all the data for that species or gives a message if that species is not in the file. Allow the user to either enter additional species’ names or quit.

This project requires careful placement of try/catch blocks to gracefully respond to file names and Species that do not exist, and, at the same time, allow the user to continue looking for Species in a file or choose another file to search.

See the code in WriteSpeciesFile.java, DisplaySpeciesFile.java, and FindSpeciesRecords.java. Uses Species.java.

Computer Science & Information Technology

You might also like to view...

When working with the Spelling and Grammar dialog box, after you make a decision on the first error, clicking ____ stops the spelling and grammar check.

A. Stop B. Cancel C. Delete D. Close

Computer Science & Information Technology

The MLS security model cannot be implemented on top of another base operating system.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology