CSC 161 Schedule Readings Labs & Projects Homework Deadlines Resources

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).

  1. The first county line contains the county name
  2. 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