1  import java.util.Scanner;
  2  
  3  public class ScoreAnalyzer
  4  {
  5     public static void main(String[] args)
  6     {
  7        Scanner in = new Scanner(System.in);
  8        GradeBook book = new GradeBook(100);
  9        System.out.println("Please enter values, Q to quit:");
 10        while (in.hasNextDouble())
 11        {  
 12           if (!book.addScore(in.nextDouble()))
 13           {
 14              System.out.println("Too many scores.");
 15              return;
 16           }
 17        }
 18        System.out.println("Final score: " + book.finalScore());
 19     }
 20  }