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