Wriite a Perl script that parses the data in census2008.txt can\'t upload files
ID: 3576278 • Letter: W
Question
Wriite a Perl script that parses the data in census2008.txt
can't upload files to chegg so im providing link to file
http://s000.tinyupload.com/index.php?file_id=09526134953682986383
The data is column delimited, with fields as follows:
SUMLEV,STNAME,CTYNAME,POPESTIMATE2008,BIRTHS2008,DEATHS2008
The data is from US Census Bureau estimates for 2008. The first column is a code for what “level” the data represents. It will be “040” for state data and “050” for county data. The next two columns are the state name and the county name (or state name repeated, if the date is for the whole state). Then we have the estimated population for that state or county in 2008, the number of births for that state or county for 2008 and the number of deaths for that state or county for 2008.
Your script should report the state with the highest and the state with the lowest birth rates in 2008.
Report the birth rate as births per 541 (a prime number) population.
Your script should also report the counties in Washington with the highest and lowest birth rates.
In all four cases, report the place name (the county or state) and the number of births per 541 population.
(Note that all counties in the US are included in the file, but your search of per-county birthrates should be limited only to the state of Washington.)
example output:
Lowest birth rate in LOW-STATE: x.xxx per 541
Highest birth rate in HIGH-STATE: x.xxx per 541
In Washington:
Lowest birth rate in LOW-COUNTY County, WA: x.xxx per 541
Highest birth rate in HIGH-COUNTY County, WA: x.xxx per 541
Explanation / Answer
In fact, Perl and Python square measure similar during this respect, that is better? it's strictly counting on personal habits.
Both Perl and Python square measure understood dynamic languages with agile syntax. In distinction, it'll be alittle easier for you to master the Python; Perl isn't smart at process the pointer with associate degree ambiguous syntax system.
However, for the structured information analytics, these 2 are literally not a far better alternative, as a result of Perl and Python aren't specifically targeted at providing structured information object, and lack relative operate libraries. Grouping, Summarizing, and different operations need to be achieved by yourself with dozens of lines of codes, significantly revolving to file information computation. it's a lot of difficult to scan and method the information from the file.
Thus, it's suggested to use esProc provided by the Raqsoft, that has complete information objects and performance libraries; most simple operations associated with structured information are often completed by one statement, additionally supports cursor-style file method and multi-threaded parallel computing. especially, the developing and debugging atmosphere is far higher than Perl and Python.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.