All pastes #729598 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-08 03:47 UTC
rendered paste body
public void printHistogram()
  {
    int[] gradescount = new int[10];
    int z = 0;
    while (z <= (count-1))
    { double tmp = grades[z];
      if(tmp >= 0 && tmp < 11) gradescount[0]++;  
      if(tmp > 10 && tmp < 21) gradescount[1]++;
      if(tmp > 20 && tmp < 31) gradescount[2]++;
      if(tmp > 30 && tmp < 41) gradescount[3]++;
      if(tmp > 40 && tmp < 51) gradescount[4]++;
      if(tmp > 50 && tmp < 61) gradescount[5]++;
      if(tmp > 60 && tmp < 71) gradescount[6]++;
      if(tmp > 70 && tmp < 81) gradescount[7]++;
      if(tmp > 80 && tmp < 91) gradescount[8]++;
      if(tmp > 90 && tmp < 101) gradescount[9]++;
      z--;
  }
    int y = 0;
    int x = 11;
    while (x <= 101)
    {
      if (x == 101)
        x = 100;
      System.out.println(y+"-"+x+":" + createStars(gradescount[y/10]));
      y = y + 10;
      x = x + 10;
    }