Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please. CENSUS 2010 Census Analysis 2018 Your job is to write a program that would help us analyze the data from 2010 census. Make

C++ please. image text in transcribed
CENSUS 2010 Census Analysis 2018 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 want to do: ated Country: ng ated ty(CA) Average Features 1 to 4 each feature must be in its own function with prototypes. Make sure to send in arguments by reference where necessary. Census Analysis 2018 Feature 0 (40): Read counties.tct into 3 parallel arays. You will see that the data file contains counties, and for each county, you have county name, state of the country and to do: ation: nter Min nter unas Census Analysis 2018 Populat Make sure that your program displays an error message and exits the program if it cannot find the file counties.bxt do you ay Count y CIA) Assume that you may have up to 5000 counties in the data file and Saline and Hinsto and kett (TX) and Knox Feature 1 (6: Population Report feature aisplays the most Galax ciEy (VA) and Lexington cityA) and least populous counties in US. It also displays the average county population. Census Analysis 2010 sByRange Feature 2 (60): Allow user to enter a population range (min and max) and then display all counties that have populaton want to do 4 range. t populous state is CA with population 3.7254e+07 Census Analysis 2010 Feature 3 (50): Two counties are simlar 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 hedonyoewnt ond similarity with every other county Feature 4 (30): 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 cumStatePop will keep the population of this state. Also let's keep maxState and maxStatePop variables. These wil hold the state with the maximum population. Now go through each county, check if the state of the county is same as CurrState. Mso, 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 cu State has the state name and the crStatePop 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 ih index Feature 0 (10): Exit Avoid Penalties! 60 points penalty if your code is not properly indented or contains no comments. 100 points penalty if you do not use functions, or your code does not compile or you use global variables Refer to screenshot displayed above for more information

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions