Write a C++ program. Write a program to read the survey results into a Vector, created in the class with the main function, and perform the following analysis. Do not use Arrays.
Write a C++
a) Print the record of each household included in the survey in a four-column format with headings.
b) Calculate and print the average household income.
c) List the identification number, income, members, and state of the household that exceeds the average in a four-column format with headings.
d) Determine and print the identification number, income, members, and state of the household, in a four-column format with headings, that have income below the 2021 United States poverty level.
e) Determine and print the percentage of households that have income below the 2021 United States poverty level.
Compute the poverty level income using one of the formulas below.
povertyLevel = 17420.00 + 4540.00 * (m – 2)
If household is in the 48 contiguous states or the District Of Columbia
povertyLevel = 21770.00 + 5680.00 * (m – 2)
If household is in the state of Alaska
povertyLevel = 20040,00 + 5220.00 * (m – 2)
If household is in the state of Hawaii
where m is the number of members of each household. This formula shows that the poverty level depends on the number of family members, m, and the poverty level income increases as m gets larger.
The input data is available in a file named, Program10.txt, on the I: drive and has the format of identification number, annual income for the household, and the number of household members.
Create a Class named, HouseHold, that contains the attributes described earlier. Write a test Class named, Program10, that creates a Vector of HouseHold objects.
No input, processing or output should happen in the main function. All work in the test class should be delegated to other functions in the class. Include the recommended minimum documentation for each function.
Every function in your program should be limited to performing a single, welldefined task, and the name of the function should express that task effectively.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps