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. You may assume no more than 25 households were surveyed. Define a structure type named household_t to store the record for one family
You need to write two separate program files. The description of each program file is as follow:
You need to write a program to create a binary data file of the household data. Data should be requested from the keyboard and written to the data file.
You need to write another program to read the household data from a binary data file. The program also calculates the average income, the household exceeding the average income, and the percentage of households having incomes below the poverty level. You need to use the same structure type household_t defined in the Program 1 above. Declare an array of the structures household_t [ 25 ] for up to 25 households.
The required user-defined functions are as follow:
Write a function to read the data from the data file created in Program 1 and store them into the array of structures.
Write a function to print the array of structures in a three-column table with the appropriate column headings.
Write a function to calculate the average income.
Write a function to find and display a listing of the identification number and income for each household exceeding the average income. The results must be in a two-column table with the appropriate column headings.
Write a function to determine the percentage of households having incomes below the poverty level. The poverty level income may be computed using the formula: P = $7500.00 + $950.00 * (m - 2) 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 increases as m gets larger.
It is not our intention to break the school's academic policy. Projects posted are only used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly fill out the form.
Please provide a valid email address and we'll get back to you in less than 24 hours.
We will be sending an invoice through PayPal upon confirmation.
We are a non profit organization however we need an amount to keep this organization running,
and to be able to complete our research and development.