85 File Page 1 of 1 Home Insert Design 293 words 92°F Sunny Layout References I I Ch 10 B Lab Instructions (1) (1) (Prot
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
85 File Page 1 of 1 Home Insert Design 293 words 92°F Sunny Layout References I I Ch 10 B Lab Instructions (1) (1) (Prot
85 File Page 1 of 1 Home Insert Design 293 words 92°F Sunny Layout References I I Ch 10 B Lab Instructions (1) (1) (Protected View) - Word (Unlicensed Product) Tell me what you want to do Mailings Review View Help Write a program that will be used to gather statistical data about the number of movies college students see in a month. The program should ask the user how many students were surveyed and dynamically allocate an array of that size. The program then should allow the user to enter the number of movies each student has seen. It should then sort the scores and calculate the average. Modularity: Main: The main function should accept the number of students from the user and dynamically create an array large enough to contain number of movies watched for each student. Input validation: The number of students should be a positive integer. Print the average and free the allocated array when complete. Get the data. This function should get the number of movies watched by each college student. Input validation: The number of movies should be a positive integer. Sort the data. This function should sort the array in ascending order. Note you may use the Standard Template Library sort function or your own sort function. To use the STL sort: Add #include <algorithm> to your program sort (arrayname, arrayname + size of array) (beginning and ending elements) Display: This function should display the sorted list of the number of movies watched. Average: This function should be a value-returning function that calculates the average of the movies watched and returns it to the main function. Sample Output: 0 Number of Movies Watched. 75 81 88 Average 81.3 Requirements: Your array must be dynamically allocated. In passing your array to functions, you must declare the array parameter using pointer notation instead of array notation, and inside each function you must use pointer notation instead of array notation to access the array elements. CLO O [email protected] W F 4) D x Share + 83% 10:48 AM 7/11/2022 1