Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

While West Virginias scenic vistas offer breathtaking views, they also pose a significant challenge for state and local governments. West Virginia has some of the

While West Virginias scenic vistas offer breathtaking views, they also pose a significant challenge for state and local governments. West Virginia has some of the least densely populated territory in the eastern United States, with one county, Pocahontas, having fewer than 10 residents per square mile. This extremely low population density contributes to a small tax base in much of the state; with so much undeveloped area, there are relatively few buildings and incomes to tax. Low population densities also make it difficult to build and maintain infrastructure. It costs nearly as much to maintain a mile of water main that has 4 customers on it as one that has 100 customers. As the population continues to shrink in much of the state, these problems will be further compounded in the coming years. Problem Statement: Investigate figures related to population density across the West Virginia. Instructions: IMPORTANT: Complete the steps below in the order they are given. Completing the steps out of order may complicate the assignment or result in an incorrect result. IMPORTANT: All your code must be in a single file. You may reference components of the C Standard Library but no other external libraries. 1. Download and extract the provided Data Files ZIP file into the same directory as your source code. It contains the following file for use in this assignment: a. counties.txt Statistics on West Virginia counties [1]. 2. Create a new C source code file named lastname_firstname_hw2_wvpp.c. Name of the county. FIPS Code Text Federal identifier for the county. Seat Text Name of the county seat. Established Number Year the county was established. Population Number Population of the county in 2010. Area Number Size of the county in square miles. 3. Create a sorted linked list to store information on each county. a. Each node in the linked list must be able to store the name, FIPS code, seat, year established, population, area, and population density for one county. b. Create a function to add new counties to the list. Counties must be stored sorted by the population density in descending order. c. Provide a function to delete individual county nodes. Users must be able to specify the name of the county to be deleted. 4. Create and call a function to retrieve data on each county from the provided counties.txt data file. The file contains fixed-width columns. For each county, perform the following tasks: a. Read its data from the provided file. b. Trim any excess whitespace after the name, FIPS code, and seat. c. Convert the year established, population, and area to integer values. d. Calculate the population density using the following formula: [] [] e. Store the county as its own node in the sorted linked list. 6. Delete nodes for the following counties from the sorted linked list: a. Ohio County b. Brooke County Computer System Concepts Page 2 of 3 Version 1.0 West Virginia University Modified 3/9/2019 7. Create and call a function to write the contents of the sorted linked list to a comma-separated file named output.csv. Do not specify a directory; let the file be written into the current folder. The file must contain a header identifying the contents of each column. Counties are to appear one to a row, with each stored value (e.g., county name, FIPS code, etc.) separated by a comma. Format the population density as a number with 2 decimal places. HINT: The first three lines of your output should resemble: County,FIPS Code,Seat,Established,Population,Area,Population Density Hancock,029,New Cumberland,1848,30676,83,369.59 Cabell,011,Huntington,1809,96319,282,341.56

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions