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

Read integers from movies.txt into a dynamically allocated array. The first number in movies.txt represents the number of students participating in this survey. Rest of the numbers represents the number of movies each student saw? Sort the array in ascending order by using Insertion Sort? Display the sorted array 10 numbers per line?

Compute and display the following:

a) Average:

b) Median: the value in the middle of a sorted array; if the array contains an even number of elements, the median is the average of the two middle elements.

c) Mode: the value which takes place most often (with the greatest frequency); if the array has no mode (none of the value takes place more than once), the mode is -1. If there is more than one mode, return one of them. For a more challenging assignment, store all values with the highest frequency in a dynamically allocated array.

Related Questions in C/C++

1. Three employees in a company are up special pay increase. You are given a file, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee ...

1. We know that from ECE 109, to calculate the equivalent resistance of a network of resistors in series in parallel are given by: Write a C++ program that asks the user to input values for resistors (as many as they wou ...

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process (make sure: at least 2 salaries mu ...

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while, do - while , and for loops. Add the following to your program: ...

Object-Oriented Programming Assignment Introduction - "A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pa ...

PROGRAMMING ASSIGNMENT #5 Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents, not ...

Programming in C Assignment Write a C program that computes and outputs the current age of the United States in days (you can use 1776 as theUS founding year). You don't have to worry about fractional years or leap years ...

4,153,160 Questions Asked

13,132 Experts

2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses,
Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.