Question: Input file.txt : https://www.dropbox.com/s/6dml0rz8lzb2nty/HADS.txt?dl=0 Write a program to determine the average amount households spend on housing (rent or mortgage) based on their income. The U.S.
Write a program to determine the average amount households spend on housing (rent or mortgage) based on their income. The U.S. Department of Housing and Urban Development's (HUD) Housing Affordability Data System (HADS) provides data samples of housing and income from across the country. Your instructor has provided you with select information from HADS in the file HADS.txt with about 59,000 lines of data. Each line in the file contains: Age Region int Built Value int Tenure int Utility Cost Income int Age of the head of household Census region Year the house was built Value of the house Rent or mortgage indicator Utility costs Monthly rent or mortgage Annual household income int int double double m only needs the Cost and Income values, but your program must Your progra in the file. The first line of the file contains header information. Your progranm readLine ) once in the beginning to get past the header read all data values should call You need to group the data by income. Each group represents a salary range of $10,000. You need to separate the households that have an income less than $10,000 from the many lines of data that show zero income. You also need to group the few households with large incomes into the t group. Your program can create an index for each group b if (income0) ) else if (income200000) )else( y: index0 index = 20; index-income10000 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
