Question: C The incomes array is created in main() and contains the (double) incomes of all the households that were surveyed. A SIZE constant has also

C

The incomes array is created in main() and contains the (double) incomes of all the households that were surveyed. A SIZE constant has also been defined before main() containing the number of households surveyed. Write the C code segments (not an entire program) that perform each of the tasks described below:

a. write the code for the entire C function that can be called from main() to calculate and return to main() the average income of all the households. Pointers are NOT to be used.

b. write ONLY the statements in main() that call the function in part a., and then outputs this statement, formatted as shown:

The average household income was $47819.55.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!