title: Calculating averages in Java?
body: <p>I created a program for <code>TestScores</code> and <code>ScoreException</code> and now I'm trying to figure out how to calculate the averages of the scores. Here are my codes when I wrote the averages code it spawned a no suitable method found for the string</p>
  
  <p><code>TestScores</code></p>
  
  <pre><code>import javax.swing.*;
  public class TestScore
  {
   public static void main(String args[]) throws Exception
    {
    int[] id = {1234, 2345, 3456, 4567, 5678};
    int[] score = {0, 0, 0, 0, 0};
    String scoreString = new String();
    final int HIGHLIMIT = 100;
    String inString, outString = "";
    for(int x = 0; x &lt; id.length; ++x)
    {  
        inString = JOptionPane.showInputDialog(null, 
          "Enter score for student id number: " + id[x]);
        score[x] = Integer.parseInt(inString);
        try
        {
           if(score[x] &gt; HIGHLIMIT)
           {
              scoreString = "Score over " + HIGHLIMIT;
              throw (new ScoreException(scoreString));
           }  
        }
        catch(ScoreException e)
        {  
           JOptionPane.showMessageDialog(null, e.getMessage());  
           score[x] = 0;
        }
        }
     for(int x = 0; x &lt; id.length; ++x)
       outString = outString + "ID #" + id[x] + "  Score " +
            score[x] + "\n";
     JOptionPane.showMessageDialog(null, outString); 
  }
  }
  </code></pre>
  
  <p>And my <code>ScoreException</code> code</p>
  
  <pre><code>public class ScoreException extends Exception
   {
    public ScoreException(String s)
    {
      super(s);
    }
   }
  </code></pre>
  
  <p>This is what I had for my average code, but it didn't come out correctly</p>
  
  <pre><code>int score[] = new score[] { 45, 98 ,80, 74, 93};
  double result = 0; 
  {
  for(int x=0; x &lt; int.length; x++){
  result += score[x];
  }
  System.out.println(result/count)
  </code></pre>