title: charAt(0) Returning an Unknown Source Error
body: <p>I've already looked in this thread:<br>
  <a href="https://stackoverflow.com/questions/17690995/stringindexoutofboundsexception-string-index-out-of-range-0">StringIndexOutOfBoundsException String index out of range: 0</a><br>
  But checking the length did not fix the issue. I'll just post my entire program here, it's not long yet. I cannot think of what the problem is...  </p>
  
  <pre><code>import java.util.*;
  
  public class Project2_Mazzone {
  public static void main (String [] args)
  {
  Scanner scan = new Scanner (System.in);
  
  String gender;
  double drinks, weight, hours, age, alcMetabolized, ratio, limit;
  char letter;
  
  System.out.println("Welcome to the BAC calculator!");
  System.out.println();
  
  //Gathering info from the drinker &amp; setting values accordingly
  System.out.print("How many drinks have you had? ");
      drinks = scan.nextDouble();
  System.out.print("How much do you weigh (in pounds)? ");
      weight = scan.nextDouble();
  System.out.print("How many hours ago did you start drinking? ");
      hours = scan.nextDouble();
      alcMetabolized = .015 * hours;      //Stores value for alcohol metabolized
  System.out.print("Are you a male or a female? ");
      gender = scan.nextLine();
      letter = gender.toUpperCase().charAt(0);
      if(letter == 'M'){      //Stores value for ratio based on gender
          ratio = .66;
      }else{
          ratio = .73;
      }
  </code></pre>
  
  <p>It's showing me this error before I even press anything on that line:<br>
  <a href="http://gyazo.com/60f1cd4fe4e0718c0c8264bfd4049be3" rel="nofollow noreferrer">http://gyazo.com/60f1cd4fe4e0718c0c8264bfd4049be3</a></p>