title: How do I use a switch statement and get the correct output?
body: <p>I am having trouble getting the output of this program to return the letter grade for the student. Also, I am having trouble with the max grade. Any help would be awesome.</p>
  
  <pre><code>   import java.util.Scanner;
  
     public class GPACalc {
  
      public static void main(String[] args) {
  
      Scanner input = new Scanner ( System.in );
      System.out.println( "Last Name: " );
      String studentName = input.next();
  
      System.out.println( "First Name: " );
      String firstName = input.next();
  
      System.out.println( "Enter CWID: " );
      int id = input.nextInt();
  
      System.out.print( "Enter Student Grades: " );
  
      int count = 0;
      double total = 0.000;
      double avg;
      int max = 0, min = 0;
  
      int gradeNum = 0;
      while ( true ) {
          int grade;
          grade = input.nextInt();
          if ( grade &lt; 0.000 || grade &gt; 100 )
              break;
  
          if ( grade &gt; max );
          max = grade;
  
          if ( grade &lt; min )
              ;
          min = grade;
          total = total + grade;
          count++;
      }
      avg = total / count;
  
      char letter = 'H';
  
      switch( letter ) {
      case 'A': 
          avg = 100;
          System.out.println("You have a perfect score. Keep up the excellent work!");
          break;
      case 'B':
          avg = 90;
          System.out.println("You have an A. Great Job!");
          break;
      case 'C':
          avg = 80;
          System.out.println("You have a B. Keep studying hard!");
          break;
      case 'D':
          avg = 70;
          System.out.println("You have a C. Commit a little more of your time.");
          break;
      case 'E':
          avg = 60;
          System.out.println("You have a D. You might want to study.");
          break;
      case 'F':
          avg = 50;
          System.out.println("You have an F. Better luck next semester.");
          break;
      case 'G':
          avg = 0;
          System.out.println( "It's time to change majors.");
          break;
      }
  
  
      System.out.println("\n----------------------------------------------------------");
      System.out.println( "    STUDENT   IFORMATION" );
      System.out.println("\n----------------------------------------------------------");
      System.out.println( "  Student Name  -- " + firstName + " " + studentName );
      System.out.println( "  Student ID    -- " + id );
      System.out.println( "  Students GPA  -- " + avg );
      System.out.println( "   # of Grades  -- " + count );
      System.out.println( "  Highest Grade -- " + max );
      System.out.println( "  Lowest Grade  -- " + min );
      System.out.println("\n----------------------------------------------------------");
  
  
  
      }
  
  }
  </code></pre>