import java.io.FileReader;
import java.util.Scanner;



public class diverScores
{


	public static void main(String[] args)
    {

		Scanner kb = new Scanner(System.in);
		double [] score = new double [8];
		double totalScore = 0.00;

		Scanner fileScanner=null;
		try{
		fileScanner= new Scanner(new FileReader("divingdata.txt"));
	    }catch(Exception e)
	    {
			System.out.println("Input file not found");
			System.exit(1);
	    }
	    while(fileScanner.hasNext())
	    {
			String fileLine = fileScanner.nextLine();
			String diverName = fileLine.substring(0,fileLine.indexOf("-"));
			String strScore = fileLine.substring(fileLine.indexOf("-")+2, fileLine.length());
			String strScoreArray[] = strScore.split(" ");

			for(int i =0; i<strScoreArray.length; i++)
			{
				score [i] = Double.parseDouble(strScoreArray [i]);
		    }
		    totalScore = calculateScore(score,8);
		    totalScore = totalScore - highScore(score, 8) - lowScore(score, 8);

		    System.out.printf((diverName) +" - "+ (totalScore%.2f) + "points\n");
	    }

    }


private static double highScore(double[] score, int maxCount)
{

         double highScore = 0;
         highScore = score[0];
         for(int i=0;i<maxCount;i++)
         {

               if (score[i] > highScore) {
                    highScore = score[i];
               }
         }
         return highScore;
}

     private static double lowScore(double[] score, int maxCount)
     {
         double lowScore = 0;
         lowScore = score[0];
         for(int i=0;i<maxCount;i++)
         {

                 //Compare the current score with the high score.


               if (score[i] < lowScore) {
                    lowScore = score[i];
               }
          }
         return lowScore;
     }


      //calculateScore function for calculating the score from the array

     private static double calculateScore(double [ ] score,int maxCount)
     {


           // Sum the scores,

          double total = 0.00;
          for (int i = 0; i < maxCount; i++) {
                 total = total + score[i];
          }
          return total;
     }

}
Attachments
import java.io.FileReader;
import java.util.Scanner;



public class diverScores
{


	public static void main(String[] args)
    {

		Scanner kb = new Scanner(System.in);
		double [] score = new double [8];
		double totalScore = 0.00;

		Scanner fileScanner=null;
		try{
		fileScanner= new Scanner(new FileReader("divingdata.txt"));
	    }catch(Exception e)
	    {
			System.out.println("Input file not found");
			System.exit(1);
	    }
	    while(fileScanner.hasNext())
	    {
			String fileLine = fileScanner.nextLine();
			String diverName = fileLine.substring(0,fileLine.indexOf("-"));
			String strScore = fileLine.substring(fileLine.indexOf("-")+2, fileLine.length());
			String strScoreArray[] = strScore.split(" ");

			for(int i =0; i<strScoreArray.length; i++)
			{
				score [i] = Double.parseDouble(strScoreArray [i]);
		    }
		    totalScore = calculateScore(score,8);
		    totalScore = totalScore - highScore(score, 8) - lowScore(score, 8);

		    System.out.printf((diverName) +" - "+ (totalScore%.2f) + "points\n");
	    }

    }


private static double highScore(double[] score, int maxCount)
{

         double highScore = 0;
         highScore = score[0];
         for(int i=0;i<maxCount;i++)
         {

               if (score[i] > highScore) {
                    highScore = score[i];
               }
         }
         return highScore;
}

     private static double lowScore(double[] score, int maxCount)
     {
         double lowScore = 0;
         lowScore = score[0];
         for(int i=0;i<maxCount;i++)
         {

                 //Compare the current score with the high score.


               if (score[i] < lowScore) {
                    lowScore = score[i];
               }
          }
         return lowScore;
     }


      //calculateScore function for calculating the score from the array

     private static double calculateScore(double [ ] score,int maxCount)
     {


           // Sum the scores,

          double total = 0.00;
          for (int i = 0; i < maxCount; i++) {
                 total = total + score[i];
          }
          return total;
     }

}
Chen Ruolin 	9.2	9.3	9	9.9	9.5	9.5	9.6	9.8	   
Emilie Heymans	9.2	9.2	9	9.9	9.5	9.5	9.7	9.6	   
Wang Xin	9.2	9.2	9.1	9.9	9.5	9.6	9.4	9.8	   
Paola Espinosa	9.2	9.3	9.2	9	9.5	9.3	9.6	9.8	   
Tatiana Ortiz	9.2	9.3	9	9.4	9.1	9.5	9.6	9.8	   
Melissa Wu	9.2	9.3	9.3	9.7	9.2	9.2	9.6	9.8	   
Marie-Eve Marleau 9.2	9.2	9.2	9.9	9.5	9.2	9.3	9.8
Tonia Couch     9.2	9	9.1	9.5	9.2	9.3	9.4	9.6	   
Laura Wilkinson	9.7	9.1	9.3	9.4	9.5	9.4	9.6	9.2

Can you provide some more information, Like,

What you did
When you got this exception i.e. while compiling or at runtime?

These thigs will help us to understand your problem easily and help you quickly.

String diverName = fileLine.substring(0,fileLine.indexOf("-"));
String strScore = fileLine.substring(fileLine.indexOf("-")+2, fileLine.length());

Guess what happens if there is no "-" in any particular line. ;-)

This question has already been answered. Start a new discussion instead.