Write a program that reads from a file created by the program in the previous programming project and displays the following information on the screen: the data for the species having the smallest population and the data for the species having the largest population. Do not assume that the objects in the file are in any particular order. The user gives the file name.

This project requires only one new file since the classes to build and view Species files are provided in the text. Populations, of course, are not unique, so more than one species may have the same smallest or largest population. If more than Species has the smallest or largest population the solution simply displays the record for the first one it encounters it its sequential search through the records in the file. Test data files should include the following situations:
• multiple records with the smallest and largest populations,
• populations that are out of order numerically,
• records with largest and smallest values in various positions in the file (the first record, the last record, and an intermediate position),
• the record with the smallest population placed before the one with the largest, and
• the record with the largest population placed before the one with the smallest.

See the code in SpeciesPopulationRange.java. Uses Species.java and files created by WriteSpeciesFile.java from the previous project.

Computer Science & Information Technology

You might also like to view...

Which formula is used to calculate the number of hosts per network or subnet? Use n to repre sent the number of bits

a. (2^n – 1) b. 2^n c. (2^n – 2) d. (n – 2)

Computer Science & Information Technology

The ____ option exists as a simple solution to help you maintain a consistent light source for multiple layer styles.

A. Constant Lighting B. Global Lighting C. Use Global Light D. Same Light For All

Computer Science & Information Technology