Question: Write a program that can be used to gather statistical data about the number of movies college students see in a month. The program should

Write a program that can be used to gather statistical data about the number of movies college students see in a month. The program should perform the following steps:

Ask the user how many students were surveyed (not less than zero).

An array of integers the size of the number of students should be dynamically allocated.

Allow the user to enter the number of movies each student saw into the array (between 0 and 100, inclusive).

Calculate the average of the values entered.

Display the result

Notes:

Whenever accessing dyn_array, use pointer notation in place of regular square array brackets.

Use the following skeleton for the main program:

int main(){

int *dyn_array;

int students;

float avrg;

do{

cout << "How many students will you enter? ";

cin >> students;

}while ( students <= 0 );

dyn_array = create_array( students );

enter_data( dyn_array, students )

avrg = find_average( dyn_array, students );

cout << "The array is:" << endl << endl;

show_array( dyn_array, students);

cout << endl;

cout << "The average is " << avrg << ". ";

delete [] dyn_array;

return 0;

}

Don't forget to block-comment every function definition.

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!