CPE 101-1 Sample Lab Quiz
4
Problem Statement
You are to write a program to process an official US Census Bureau data
file of ZCTAs (ZIP Code Tabulation Areas). The file contains an
unknown number of lines, and each line has nine fields separated by one
or more blanks:
Field 1: US Postal Service State Abbreviation
and 5-digit zipcode
Field 2: Total Population (Year 2000)
Field 3: Total Housing Units (Year 2000)
Field 4: Land Area (square meters - integer)
Field 5: Water Area (square meters - integer)
Field 6: Land Area (square miles - decimal)
Field 7: Water Area (square miles - decimal)
Field 8: Latitude (decimal degrees)
Field 9: Longitude (decimal degrees)
There may be up to 43000 records in the file.
The purpose of the program is to find the average population of the
ZCTA’s that are north of a latitude entered by the user.
Necessary Formulas: Latitude of 0 degrees is the equator, the
North Pole is positive 90 degrees.
DIRECTIONS
1. Copy from the ~cs101-1 account on hornet
a data
file named zcta_CA.txt.
2. Copy from the ~cs101-1 account on hornet
a
skeleton file named quiz4Askeleton.c.
3. Rename the file to quiz4.c
4. Examine the skeleton code to determine which
portions have been provided and which portions are incomplete.
5. Finish the remainder of the implementation to find
the average population of the ZCTA’s that are north of a latitude
entered by the user.
6. Test your completed program. At the bottom of this
page show or briefly explain how you verified the correctness of your
solution.