public float Median() { List <int> Numbers = new List <int>(); for (int i = 1; i < ScoreCount.Count(); i++) { for (int j = 0; j < ScoreCount[i]; j++) { Numbers.Add(i); } } if (Numbers.Count == 0) { return(0); } int HalfIndex = Numbers.Count() / 2; if (Numbers.Count() % 2 == 0) { return((float)(Numbers[HalfIndex] + Numbers[HalfIndex - 1]) / 2); } else { return(Numbers[HalfIndex]); } }
public int Dominant() { int modal = 1; for (int i = 2; i < ScoreCount.Count(); i++) { if (ScoreCount[i] > ScoreCount[modal]) { modal = i; } } return(modal); }
public float Avg() { int Total = 0; for (int i = 1; i < ScoreCount.Count(); i++) { Total += i * ScoreCount[i]; } if (Total == 0) { return(0); } return((float)Total / TotalScoreCount); }