Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

10. Microsoft Corporation

Answered: 1 week ago

Question

4. EMC Corporation

Answered: 1 week ago