This project requires you to write a C++ program that will manage a list of bird species and counts stored in an array of structs. This program will give you practice inputting data from files, writing and calling functions, using arrays and outputting data to a file. You should only use one array of structs. ARRAY_SIZE = 200 will be large enough for any of the input data files.
A text file contains information obtained from the Great Backyard Bird Count. The first line of the input file contains the name of the city where the birds were observed. The city name may contain blanks so you will need to use getline to input the city name. Each line after that contains the species of bird, followed by an integer count. The bird species will not contain blanks.
Prompt the user to input the name of the data file. Input and echo the city name. Input the bird data into an array of structs.
After the data is in the array, prompt the user to modify the array by inputting a species name and a count. If the species is not in the array, print a message indicating this and add the species to the end of the array. If the species is in the array, change the count in the array to the new count. Allow the user to input any number of changes.
After the changes to the array, use Selection Sort to sort the data alphabetically by species name. Print a labeled listing of the sorted data to the screen.
After sorting, perform each of the following calculations and print the results to the screen:
1. Print out the total number of birds reported. (not the number of species, but the number of birds)
2. Print out the name of the species with the maximum number of birds reported. You may assume a unique maximum.
After the calculations are completed, print out the sorted array of birds to an output file. Make sure to include the name of the city where the counts were taken. Also remember to include your name and lab CRN in the output file.
Well make a struct that describes a bird, make an array of the structs, populate it, then print it. Start with the first bit and continue segment by segment. When you get stuck on a specific part, then let us know.
Programming is all about solving complex problems. You solve the complex problems, by breaking them down into smaller entities. Then what appeared at first to be complex becomes manageable. So as @Stewbond said make a start...