Answered step by step
Verified Expert Solution
Link Copied!

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++.

image text in transcribed
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 look

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

What are the various principles of material handling ?

Answered: 1 week ago

Question

Explain the process planning.

Answered: 1 week ago

Question

What do you mean by 'make or buy decision ' ?

Answered: 1 week ago