so im trying to find the min, max, range, mean, median, and mode. The max number is right but the min isnt. Once that is corrected, i can get range and mean easily. Also, i have no idea how to get mode and median. Im guessing the values in the arr2 would have to be sorted. Any thoughts? Id appreciate it.
This refers to the values in arr2 which are the calculated values in the formula. You can enter -2 and 2 for userMin and userMax.
For median you are going to need to sort your code and then just divide your array in half. Whichever value is at the half point will be your median. If your array has an even number of values, you are going to have to make an arbitrary choice on whether the higher or lower value should be picked as the median.
As for mode, that requires that each array element also has a way of keeping track of it's occurrences. You can do this multiple ways, create a secondary array that holds the number of occurrences of the first array with the data. You could create a simple struct to hold the data and a counter for the number of times the data has been entered. Your choice really.