Question: In part 3 , you will be working individually to finish the following exercise using 1 D static array. Files needed for this part: array.cpp

In part 3, you will be working individually to finish the following exercise using 1D static array. Files needed for this part: array.cpp
1. Prompt the user for the size of the array, ensuring the size is between 5 and 50, inclusive. If an invalid size is given, re-prompt until a valid size is provided. (Note: you may assume that the user will enter an integer value. (i.e., you are required to handle errors of the same data type))
2. Implement a function named populate_array() that takes an integer array, and the array size as parameters and fills the array with randomly generated values. Each element in the array should be a random integer between 1 and 100, inclusive.
void populate_array (int array[], int size);
3. Print out the following statistics of the generated array:
o The sum of all elements in the array.
2
o The maximum and minimum value among the array elements. o The average of all array elements.
4. After presenting the statistics, ask the user if they want to perform the entire process again. If the user chooses to repeat, go back to step 1. If they choose to quit, end the program.

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!