Question: Create an interactive program using 1 user defined function, 1 counting loop, 1 input validation loop, and an array.You need to create a program that
Create an interactive program using user defined function, counting loop, input validation loop, and an array.You need to create a program that fills in an array of doubles and calculates the average of the array. Declare the doubles array to be a size of Ask the user for how many doubles they would like to add to the array maximum of the size of the array Store this value into a variable called count. Implement a loop to make sure that the user enters a value within this range Fill the array in the main function with user input, one double at a time, before passing it to the ArrayAvg function. Store these doubles in an array called arr. The value of count and the array will be passed to a function called ArrayAvg. Return the average to the main function and print out the average.Please refer to the following prototype and example output.double ArrayAvg double arr int count;prototypeArrayAvg function takes in a double array double arr and the number of doubles within the array int count from the main functionreturns the average of the array double to the main functionthe average of the array should be printed out by the main functionExample output:Please enter the number of elements in your array: Please enter number out of : Please enter number out of : Please enter number out of : Please enter number out of : The average of the array is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
