Repeat the previous programming project, but read the input data from a file and send the output

Question:

Repeat the previous programming project, but read the input data from a file and send the output to another file. If you have covered binary files, use binary files; otherwise, use text files. Read the file names from the user.


Previous programming project

Define a variation on StringLinkedListSelfContained from Listing 12.7 that stores objects of type Species, rather than of type String. Write a program that uses that linked-list class to create a linked list of Species objects, asks the user to enter a Species name, and then searches the linked list and displays one of the following messages, depending on whether the name is or is not on the list:

Species Species_Name is one of the
Number_Of_Species_Names_On_List species on the list.
The data for Species_Name is as follows:
Data_For_Species_Name
or
Species Species_Name is not a species on the list.

The user can enter more Species names until indicating an end to the program. The class Species is given in Listing 5.19 of Chapter 5. (If you prefer, you can use the serialized version of Species in Listing 10.9 of Chapter 10.)

Listing 5.19

Species - name: String - population: int growthRate: double + readInput (): void + writeOutput (): void + predictPopulation (int years): int + setSpecies (String newName, int newPopulation, double newGrowthRate): void + getName (): String + getPopulation (): int + getGrowthRate(): double + equals (Species other0bject): boolean


Listing 10.19

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: