Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in C code, not C++. Average an Array - a collaborative mgram ASSIGNMENT: Write a program to calculate and display the average of
Please write in C code, not C++.
Average an Array - a collaborative mgram ASSIGNMENT: Write a program to calculate and display the average of all the values in an array. You will have 3 functions (not including main()) in the program - an inputf nation to populate the array, 3 process'rng fundiun to calculate the average ofthe array's values, and an output function to display the average. Start by creating an array that can hold 10 doubles. Pass the array and its size to the lnputfunction, and have the input function populate the away with 10 values entered by the user The inputfunctlon should be a void function, since the array will be passed by pointer. Then, pass the array and its size to the processing function. and have the processing function calculate and return the average of all the values in the array. Finally, pass the average returned by the processing function to the output function to display the average Although the program should be wrilen for an array of 10 doubles, since the input and processing tuncllons have Ihe anay's size piassed to them. the lunctions should work for an array of any size. Example Run #1: (bold type is what is entered by the user) Enter a value for #l: 5.23 Enter a value for #2: 1.6 Enter a value for #3: 3.0 Enter a value for #4: 6.159 Enter a value for #5: 3.33 Enter a value for #6: 12.4 Enter a value for #7: 9.7 Enter a value for #8: 78.1 Enter a value for #9: 2.58 Enter a value for #10: 4.45 The average of the values is xxx. The example run shows EXACTLY how your program input and output will lookStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started