Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

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

Step: 3

blur-text-image

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

What is human nature?

Answered: 1 week ago