Question: Coral Programming Define a function named computeAverage that takes one parameter: an array of integer and outputs an integer that is the average of the

Coral Programming Define a function named computeAverage that takes one parameter: an array of integer and outputs an integer that is the average of the all integers in the array

Write a main program that reads integers from input. The first integer is the size of an array.. All other integers will be values of the array. Then the program calls function computeAverage with the array as arguments. Function computeAverage will return the average of all integers in the array. Then the main program output the result

Ex: if the input is: 5 2 1 6 2 4

where 5 is the size of the array, the output is:

3

Your program should define and use a function:

Function computeAverage(integer array(?) userVals) returns integer average.

Coral Programming Define a function named computeAverage that takes one parameter: an

Define a function named computeAverage that takes one parameter: an array of integer and outputs an integer that is the average of the all integers in the array Write a main program that reads integers from input. The first integer is the size of an array.. All other integers will be values of the array. Then the program calls function computeAverage with the array as arguments. Function computeAverage will return the average of all integers in the array. Then the main program output the result Ex: if the input is: 521624 where 5 is the size of the array, the output is: 3 Your program should define and use a function: Function computeAverage(integer array(?) userVals) returns integer average

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!