Hello to anyone,
median - there is no equation for median. It it the value such that there are an equal number of values larger and smaller. For an odd number of values, if they are sorted, it is value in the middle of the list. If there are an even number of values, it is the mean of the middle two grades.
double median(int grades[], int num);
This function takes as input, num, the number of grades in the array, and grades, a pointer to the array in main. It finds the median grade in the array and returns this value. The simplist way of finding the median is to sort the grades by value. Then you can find the index for the median grade by using the definition for median above (it will be the middle index if there are an odd number of grades, or you will have to average the two middle grades if there are an even number). You can use the bubble sort function to do the sorting.
Here is my code if any one can help please



LinkBack URL
About LinkBacks


