/**
 * A simple application that prompts the processes 
 * grades (provided as command line arguments)
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class GradeProcessor
{
    /**
     * The entry-point of the application
     *
     * @param grades  The space-delimited grades
     */
    public static void main(String[] grades)
    {
       double         total;
       final double   DEFAULT = 50.0;       


       total = 0;       
       for (int i=0; i<grades.length; i++)
       {
          try
          {
             total += Double.parseDouble(grades[i]);
          } 
          catch (NumberFormatException nfe)
          {
             total += DEFAULT;
          }
       }

       System.out.printf("Average: %3.1f", total/grades.length);       
    }
}
