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.
You might also like to view...
Which of the following is NOT true about wireless data networks?
A. locations where service is available has increased 40% annually since 2007 B. virtually all laptop computers have wireless capability C. wireless networks are usually only found in airports and hotels D. hundreds of millions of wireless devices are sold each year
Match the following units with their prefix values
I. Kilo II. Tera III. Exa IV. Zetta V. Yotta A. 1 trillion B. 1,000 peta C. 1,000 D. 1,000 zetta E. 1,000 exa
The aspect ratio is the ratio of an image's width to its height.
Answer the following statement true (T) or false (F)
FIGURE 15-1Figure 15-1 above shows stages in the life of a(n) ____.
A. parameter B. thread C. process D. socket