Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SHOULD BE DONE IN C++ visual studio CENSUS 2010 Your job is to write a program that would help us analyze the data from 2010

SHOULD BE DONE IN C++ visual studio

CENSUS 2010

Your job is to write a program that would help us analyze the data from 2010 census. Make sure to download counties.txt. You will need to read this file and display a series of reports on the data.

Features 1 to 4 -- each feature must be in its own function with prototypes. Make sure to send in arguments by reference where necessary.

Feature 0 : Read counties.txt into 3 parallel arrays. You will see that the data file contains counties, and for each county, you have county name, state of the country and population. Make sure that your program displays an error message and exits the program if it cannot find the file counties.txt. Assume that you may have up to 5000 counties in the data file.

Feature 1 : Population Report feature displays the most and least populous counties in US. It also displays the average county population.

Feature 2 : Allow user to enter a population range (min and max) and then display all counties that have population within that range.

Feature 3 : Two counties are similar if they have the same population and they are in the same state. Display all counties that are similar. Hint: you need a nested loop here -- loop inside loop. For each county, you need to check its similarity with every other county.

Feature 4 : Find and display the state with the most population. Hint: because states are on multiple rows, we need to keep track of the state of each county. Fortunately, the counties are sorted by state. So assume you have a variable named currState which will keep the state you are currently following. currStatePop will keep the population of this state. Also lets keep maxState and maxStatePop variables. These will hold the state with the maximum population. Now go through each county, check if the state of the county is same as CurrState. If so, we need to add the population of this county to currStatePop. Otherwise, that means we found a county with a new state. That also means we are done with reading counties from currState. At this point currState has the state name and the currStatePop has the total population of currState. Check if currStatePop is larger than maxStatePop, if so, we need to set maxState and maxStatePop to currState and currStatePop, respectively. And then we need to set currState to the state at ith index of the for loop and currStatePop will be set to the population of the county at ith index.

Feature 0 : Exit

Aleutians_East_Borough AK 3141 Aleutians_West_Census_Area AK 5561 Anchorage_Municipality AK 291826 Bethel_Census_Area AK 17013 Bristol_Bay_Borough AK 997 Denali_Borough AK 1826 Dillingham_Census_Area AK 4847 Fairbanks_North_Star_Borough AK 97581 Haines_Borough AK 2508 Hoonah-Angoon_Census_Area AK 2150 Juneau_City_and_Borough AK 31275 Kenai_Peninsula_Borough AK 55400 Ketchikan_Gateway_Borough AK 13477 Kodiak_Island_Borough AK 13592 Lake_and_Peninsula_Borough AK 1631 Matanuska-Susitna_Borough AK 88995 Nome_Census_Area AK 9492 North_Slope_Borough AK 9430 Northwest_Arctic_Borough AK 7523 Petersburg_Borough AK 3815 Prince_of_Wales-Hyder_Census_Area AK 5559 Sitka_City_and_Borough AK 8881 Skagway_Municipality AK 968 Southeast_Fairbanks_Census_Area AK 7029 Valdez-Cordova_Census_Area AK 9636 Wade_Hampton_Census_Area AK 7459 Wrangell_City_and_Borough AK 2369 Yakutat_City_and_Borough AK 662 Yukon-Koyukuk_Census_Area AK 5588 Autauga_County AL 54571 Baldwin_County AL 182265 Barbour_County AL 27457 Bibb_County AL 22915 Blount_County AL 57322 Bullock_County AL 10914 Butler_County AL 20947 Calhoun_County AL 118572 Chambers_County AL 34215 Cherokee_County AL 25989 Chilton_County AL 43643 Choctaw_County AL 13859 Clarke_County AL 25833 Clay_County AL 13932 Cleburne_County AL 14972 Coffee_County AL 49948 Colbert_County AL 54428 Conecuh_County AL 13228 Coosa_County AL 11539 Covington_County AL 37765 Crenshaw_County AL 13906 Cullman_County AL 80406 Dale_County AL 50251 Dallas_County AL 43820 DeKalb_County AL 71109 Elmore_County AL 79303 Escambia_County AL 38319 Etowah_County AL 104430 Fayette_County AL 17241 Franklin_County AL 31704 Geneva_County AL 26790 Greene_County AL 9045 Hale_County AL 15760 Henry_County AL 17302 Houston_County AL 101547 Jackson_County AL 53227 Jefferson_County AL 658466 Lamar_County AL 14564 Lauderdale_County AL 92709 Lawrence_County AL 34339 Lee_County AL 140247 Limestone_County AL 82782 Lowndes_County AL 11299 Macon_County AL 21452 Madison_County AL 334811 Marengo_County AL 21027 Marion_County AL 30776 Marshall_County AL 93019 Mobile_County AL 412992 Monroe_County AL 23068 Montgomery_County AL 229363 Morgan_County AL 119490 Perry_County AL 10591 Pickens_County AL 19746 Pike_County AL 32899 Randolph_County AL 22913 Russell_County AL 52947 

SHOULD BE DONE IN VISUAL STUDIO.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago