Calculate the weighted average of a list of n numbers

Calculate the weighted average of a list of n numbers using the formula
xavg = f1x1+f2x2+ ….+ fnxn
where the f’s are fractional weighting factors, i.e.,
0<=fi<1, and f1+f2+….+fn = 1
Test your program with the following data:
i = 1 f = 0.06 x = 27.5
2 0.08 13.4
3 0.08 53.8
4 0.10 29.2
5 0.10 74.5
6 0.10 87.0
7 0.12 39.9
8 0.12 47.7
9 0.12 8.1
10 0.12 63.2
Write a complete C program for above the problem. Use whatever control structures are most appropriate for each problem. Begin with a detailed outline. Rewrite the outline in pseudo code if the translation into a working C program is not obvious. Be sure to use good programming style (comments, indentation, etc.)

Showing Answers 1 - 1 of 1 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions