Question: #include #include using namespace std; int main() { int *studentnum; int students_surveyed; int count; int total; double average; double median; cout < > students_surveyed; studentnum

#include 
#include  using namespace std; int main() { int *studentnum; int students_surveyed; int count; int total; double average; double median; cout<<"How many student are surveyed?"<< endl; cin>> students_surveyed; studentnum = new int [students_surveyed]; cout<<"Write by order, the number of movies watched by each of the students" <> studentnum [count]; } total += studentnum [count]; average = total/students_surveyed; { cout<< "The total of movies watched by all the students is:" << total << "movie." < 

I need to build 3 functions, one that calculates and display the average of the movies watched, the median and the mode. Three different functions. I had the idea of using one of my functions but I don't know how to implement it as one of the requirements is: All array accessing should be done with pointers and not via direct access. For example, if I had an integer array called movies and wanted to access index.

This is my function:

double findAverage(double m[], int size) { int count = 0; double total = 0; for (int i = 0; ireturn total / count; } 

And also I need to do some input validation of the movies, I can't allow negative numbers.

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!