C++ ONLY
The question is -
The US Census Bureau gathers population information and aggregates it at the city, county and state level. A research project on population distribution in the Southeast US has acquired a data file from the Census Bureau that contains the populations of each county in Mississippi (MS) and Florida (FL). For this research project write a program that calculates the average county population for these two states.
Each line in the Census Bureau data file has the following structure
NJ Burlington 451336
The first field (starting at the first character) contains the two letter code for the state. The second field is the name of the county, and the third field is the 2010 population. The fields are separated by a single tab character. The input data lines are in no particular state order. Don't make any assumptions about the number of lines in the file. A data file for testing your program can be found here.
Write a program that asks the user for the input file's name. Open the file and read each line. Sum and average the appropriate values. Once all of the input lines are read, write out the average county population for each state, both to the console and to an output file. Format your output so that a user can understand the meaning of the calculation, i.e. don't just output "state average". The average value should also be formatted to have 1 decimal place using the fixed decimal format. So you should perform floating point arithmetic operations. Your program should have the following functions:
A function that opens the input and output files and sets the output of the floating-point number to one decimal place in a fixed decimal format.
A function that initializes the variables needed in the main program. (hint: you will need to use pass by reference in this function.)
A function that adds a county population to the current sum for a state.
A function that calculates the average county population for a state. (hint: this function should return a floating point value.)
A function that outputs the relevant results to the console and into the output file.
Do not use global variables in this program. Use the appropriate parameters to pass information in and out of the functions.
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
C++ ONLY The question is - The US Census Bureau gathers population information and aggregates it...
The Census Bureau groups data on households into census tracts,
where each census tract has a total population of about 4,000
residents. Census tracts should be divided so that the households
in the census tracts share certain characteristics, such as
economic status. Even though most tracts are around 4,000
residents, there is some variability, which is the focus of this
lab. In practice, census tracts usually have a population between
1,200 and 8,000 people.
I just need help with the...
C++
3. Write a program that reads integers from a file, sums the values and calculates the average. a. Write a value-returning function that opens an input file named in File txt. You may "hard-code" the file name, i.e., you do not need to ask the user for the file name. The function should check the file state of the input file and return a value indicating success or failure. Main should check the returned value and if the file...
C++. You are working for the census bureau and you need to write
a program to do the following:
A). Count the number of people in each of the following age groups:
0-18 infant, 18-29 young, 29 - 50 middle aged, 50 - 69 old, 69 -
and older really old. Report the number of people in each age
group. (use some random data for test).
B). They need some statistics regarding the distribution of ages.
Write a program to...
This is a C programming question. We have a file containing floating point numbers (we don't know how many). Write a complete C program that alternately averages only the floating point numbers (for example 3.50, 12.507, 123.60,5.98 would lead to the result (12.507+5.98)/2), ignore the whole numbers. Use file input, assuming the file is named "numbers.data". The program should be compatible with files that contain several numbers on separate lines.
Problem Statement You are to create a Visual Basic(VB) project for a census bureau to obtain and analyze household income survey data within the Pittsburgh area (including Morgantown Ky). Data Collected: Home identification code (4 alphanumeric characters) – required Program should generate it using a random number generator. You won’t use this anywhere it just need to be generated. Generate the first number in the Form Load event and then each subsequent number in the button click. See attached code...
Using C++. Please Provide 4 Test Cases.
Test #
Valid / Invalid Data
Description of test
Input Value
Actual Output
Test Pass / Fail
1
Valid
Pass
2
Valid
Pass
3
Valid
Pass
4
Valid
Pass
Question 2 Consider a file with the following student information: John Smith 99 Sarah Johnson 85 Jim Robinson 70 Mary Anderson 100 Michael Jackson 92 Each line in the file contains the first name, last name, and test score of a student. Write a...
C++ program
For research purposes and to better help students, the admissions office of your local university wants to know how well female and male students perform in certain courses. You receive a file confidentiality, the letter code f is used for female students and m for male students. Every file in the file is unknown. Write a program that computes and outputs the average GPA for both (ECPartIData.txt) that contains female and male student GPAs for certain courses. Due...
Description Write C++ code that correctly input and output information. (Moving data to and from the screen and to and from text files. Also inputting predefined functions, etc., from included libraries.) Problem Description Consider a data file that has geometrical angle values in degrees. Angle values may be on one line, several lines, or any other white space separated format. Fig. 1 below shows one possible format, but other formats are possible. 12.9 100.8 270.5 300.6 120.8 There are no...
Write a C++ program that will read in image data from the file "image.txt" and illustrate that image as ASCII art. The Image file will contain several lines, representing horizontal rows in the image, and each line will have several integers in the range 0-255. representing povels, separated by spaces. You should read this image data into a vector vector in Once you've read in the phel data, go through the image and print out each piel in the image...
Please don't use a void fuction and this is a c++ question.
Thanks
Write a program that reads two input files whose lines are ordered by a key data field. Your program should merge these two files, writing an output file that contains all lines from both files ordered by the same key field. As an example, if two input files contain student names and grades for a particular class ordered by name, merge the information as shown below Using...