Question:
I am new at this Computer Programming?
anonymous
2013-03-05 13:37:23 UTC
I am new at this computer programming stuff and my teacher has given me this problem and I have no idea how to even do this

PROGRAM 410t
(Household Income Report)

Program Description: The results of a survey of the households in your township have been made available. Each record contains data for one household, including a four-digit integer identification number, the annual income for the household, and the number of members of the household. Write a program to read the survey results into three arrays, echo print the data and perform and output the following analyses:

1. Count the number of households included in the survey and print a three-column table displaying the data read in (assume no more than 25 households)

2. Calculate the average household income, and list the identification number and income of each household that exceeds the average.

3. Determine the percentage of households having incomes below the poverty level. The poverty level income may be computed using the formula: p= $3750.00 + $750.00 * (m-2) where m is the number of members of each household.

Run the program twice to verify it's accuracy.

Statements Required: input, output, decision making, array, methods, class

Data Location: survey2.dat
survey.dat

Sample Output: (your output will be in a single column and will include output from the second file)
id income members
1041 12180 4
1062 13240 3
1327 19800 2
1483 22458 8
1900 17000 2
2112 18125 7
2345 15623 2
3210 3200 6
3600 6500 5
3601 11970 2
4725 8900 3
6217 10000 2
9280 6200 1



Households with income exceeding an average income of 12707.4
id income members
1062 13240 3
1327 19800 2
1483 22458 8
1900 17000 2
2112 18125 7
2345 15623 2

Percent of households below poverty level = 0.0769231

Here is what is in survey.dat file
2497 12500 2
3323 13000 5
4521 18210 4
6789 8000 2
5476 6000 1
4423 16400 3
6587 25000 4
3221 10500 4
5555 15000 2
1085 19700 3
3097 20000 8
4480 23400 5
2065 19700 2
8901 13000 3

Here is what is in Survey2.dat file
1041 12180 4
1062 13240 3
1327 19800 2
1483 22458 8
1900 17000 2
2112 18125 7
2345 15623 2
3210 3200 6
3600 6500 5
3601 11970 2
4725 8900 3
6217 10000 2
9280 6200 1
Three answers:
John
2013-03-10 04:26:05 UTC
(your output will be in a single column and will include output from the second file) ???

in a single column??? dont understand, please specify. it should be three columns (id, income, members)



https://docs.google.com/document/d/1j_O4IakWnLuyvOZ2104mQCVne91a2y1frmivulDqVV8/edit?usp=sharing
kunis
2016-10-06 10:27:55 UTC
maximum probable it grow to be some form of flash application. in case you want a custom application geared up that helps you particular effective properties that specialize on your business enterprise you will ought to greater a flash developer. That the astounding thing approximately desktops... in case you are able to dream it. then this is accomplished (nicely to an quantity). good success
galt_57
2013-03-12 16:45:59 UTC
Ok, so you are learning Java. Do you know how to read a text file? If not you can easily Google for code examples.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...