I have two small programs to write. The only problem, I have no experience with C and very limited Java experience. Sorry if this is long-winded, but I'm at a loss.

The one I'm working on now is a stats tracker of sorts. I have to take an array of numbers and find the max, min, mean, median, mode, and standard deviation.

My first problem and the one holding me up currently:

I'm trying to create the array where the values will be user inputs. First, it should ask the user for the amount of elements in the array. Then it should ask for the elements to fill the array, one at a time. I don't know how any inputs in this language work. I read something about a scanf function but couldn't understand how to use it.

My second question is in regards to calculating the mode. It's simply as to how would I be able to keep track of the number of times each number occurs in the array, and if several numbers occur the same amount, having them all print. All I can think to do is set up a for loop to go through the array and check to see if the second element is equal to the first. If so, increase the number of a temporary variable for that number. Only the problem doing it that way is counting the same element multiple times. Possibly copying the array into a new one, and if that element is equal to the one it is being compared to, increment the temp variable then removing it from the array? I'm not sure how to go about that, as I'd have to keep track of the number of the elements in the array so that I don't get garbage or anything.

We were given sample code for qsort, but I can't make heads or tails of that as I still don't understand pointers. So I figured I'd just go the slow route for now and use a for loop to go through the array to sort them. I believe to delete the old array after it's:or is it free?Code:delete[] array;

There's hardly anything to this code. I just filled in what I knew how to code already.

Code:int main() { int numElem; int array[numElem - 1]; int i; int max; int min; float mean; float median; int mode; float stdev; //Create the array for (i = 0; i < numElem; i++) { //TODO: Sort the array for easier use //TODO: Compute the max //TODO: Compute the min //TODO: Compute the mean //TODO: Compute the median //TODO: Compute the mode //TODO: Compute the standard deviation //Prints the computed values next to appropriate lables printf("Max: %d\n", max); printf("Min: %d\n", min); printf("Mean: %d\n", mean); printf("Mode: %d\n", mode); printf("StDev: %d\n", stdev); }