Processing Census Data
The file
iowa-county-populations.txt
contains population and ethnicity information for Iowa counties from
the 2010 census. County information is contained on two successive
lines, followed by a blank line (for readability).
- The first county line contains the county name
-
The second county line specifies the population of various
ethnic groups within the county.
- Column 1 gives the total population
- Column 2 gives the number of whites only (no mixed race)
- Column 3 gives the number Black or African Americans only
- Column 4 gives the number of American Indians and Alaska Natives only
- Column 5 gives the number of Asians only
- Column 6 gives the number of Native Hawaiians and Other Pacific Islanders only
- Column 7 gives the number of people identifying two or more races
Write a program that reads a filename amd column from the terminal and then determines the ranking of Poweshiek County (where Grinnell sits) regarding the population from that column. The result should be a ranking number (where 1 means that the county has the largest number of column's ethnicity and 99 means that the count has the smallest number of Iowa's 99 counties).
Programming Notes
- In consideration of space efficiency, arrays may not be used in this problem. Arrays place constraints on the number of counties that might be present in a state.
- In consideration of processing efficiency, the program should read through the file no more than twice. Multiple passes through the data would require many disk accesses, which involves substantial overhead.
