public class Averages
{
  public static void main(String args[])
  {
    final int MAXSIZE = 100;
    double scores[] = new double[MAXSIZE];
    double sum = 0.0;
    double average;
    int count = 0;
    double temp;
 
    temp = IOStuff.getDoublePrompt("Enter a score (or -1.0 to quit:");
    while(temp >= 0.0 && count < MAXSIZE)
    {
      sum = sum + temp;
      scores[count] = temp;
      count++;
      temp = IOStuff.getDoublePrompt("Enter a score (or -1.0 to quit:");
    }

    average = sum / (double)count;
    for(int i = 0; i < count; i++)
    {
      System.out.println(scores[i] + " " + (scores[i] - average));
    }
  }
}
