Java Array Grading
<p>I was looking for some input on my code. What i'm trying to do is get user input in the form of scores on a test or something. The user can input how many grades they need to enter and it stores them on the array. Then the program will grade on a curve with the highest being an A. if a score is within 10 points of the highest score, it is also an A, if its in between 10 to 20 points less than the higher score its a B, if its 20 to 30 points less than the highest score then its a C, and so on till F.</p>

<p>My issue is that I don't know how to compare a certain element to the highest to see what grade it is. So my question is how do you compare a certain element in an array to the highest element in the array?</p>

<pre><code>import java.util.Scanner;

public class StudentGrades {

    public static void main(String[] args) {
        Scanner keyboard = new Scanner(System.in);
        int students;


        System.out.println("How many students do you have?");
        students = keyboard.nextInt();
        while (students &lt; 0) {
            System.out.println("Invalid student amount");
            students = keyboard.nextInt();
        }
        int[] kids = new int[students];

        double[] scores = new double[students];

        for (int index = 0; index &lt; students; index++) {

            System.out.println("Enter score for student #" + (index + 1) + ": ");
            scores[index] = keyboard.nextDouble();

        }
        double high = scores[0];
        for (int index = 1; index &lt; scores.length; index++) {
            if (scores[index] &gt; high) ;
            high = scores[index];

        }

        if (//place in array &gt;= (highest-10)
                System.out.println("Student (whatever there position is) has an A")
    }

}
</code></pre>

<p>So if anyone can give me some insight into this issue I'll be grateful, also if you see anything wrong with the code please tell me. Any help would be great. Just to clarify my issue is with trying to find the letter grade. look at the if statement at the bottom.</p>