Write a program that can be used to gather statistical dataabout the number of m
ID: 3618054 • Letter: W
Question
Write a program that can be used to gather statistical dataabout the number of movies college students see in a month. Theprogram should perform the following steps:
A)Ask the user how many students were surveyed. An array ofintegers with this many elements should then be dynamicallyallocated.
B)Allow the user to enter the number of movies each student sawinto the array.
C)Calculate and display the average, median, and mode of thevalues entered. (Use the functions you wrote in Problems 8 and 9 tocalculate the median and mode.)
Input validation: Do not accept negative numbers forimput.
NOTE: You need to use two more functions: one to calculate anddisplay the average of the values entered, and another to displaythe contents of the array that is dynamically allocated and thenloaded.
Explanation / Answer
please rate - thanks #include using namespace std; double average(int[],int); void print(int[],int); void sort (int[],int); double median (int [], int ); int mode(int [], int ); int main() {int num,i; coutnum; int movies[num]; for(i=0;iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.