title: Using User Input to for organizing grades, ranks and average in Java
body: <p>I'm in a Java beginning course and am having problems extracting data from user input  and using it to create a set of grades based on the amount of user input.  I'm then supppose to organize that set of data from highest to lowest and average it out.  Here is my code so far </p>
  
  <pre><code>    //import Scanner
  
  import java.util.Scanner;
  
  public class Looper {
  
  
    public static void main(String[] args) {
  
      //introduce integers
      int highest = 0;
      int lowest = 0;
      int count = 0;
      int grade = (int) (Math.random() * 100);
      int student;
  
      int total = 0;
      double average = 0;
      //introduce Scanner 
      Scanner input = new Scanner(System.in);
  
      //printout number of students
      System.out.println("Enter number of students");
      student = input.nextInt();
      //narrow amount of students 
      if (student &lt;= 10) {
        System.out.println("Enter the grades of the students");
      }
  
      else if (student &gt;= 11) {
        System.out.println("Too many Students");
      }
      //close off 0               
      while (student != 0) {
        System.out.println("Didn't enter students");
      }
  
      grade = input.nextInt();
      //connect student and grade         
      for (grade = 0; grade &lt;= 100; grade++) {
        student = grade;
        if (grade &gt; 100) {
          System.out.println("Must be between 0 and 100")
        } if (grade &lt;= highest) {
          grade++;
        }
      }
  
      for (grade = 0; grade &gt;= 0; grade++) {
        student = grade;
        if (grade &lt; -1) {
          System.out.println(" Must be between 0 and 100");
        }
        else if (grade &gt;= lowest) {
          grade++;
        }
        //   form total and average
        total = total + grade;
        grade++;
        {
          average = (double) total / grade;
          //printout highest, lowest, and average
          System.out.println("The highest is" + highest + "\n The lowest is" + lowest + "The     average is\n" + average);
        }
      }
    }
  }
  </code></pre>