title: Exception in thread “main” java.util.InputMismatchException "Temperature program"
body: <p>Can someone help with this? I can get it to run, but after the output message "What is the outside Temperature:" "Number here"</p>
  
  <p>Type (C) for Celsius or (F) for Fahrenheit:</p>
  
  <p>Once I type in C or F it gives me this error message</p>
  
  <p>Exception in thread "main" java.util.InputMismatchException</p>
  
  <pre><code>at java.util.Scanner.throwFor(Scanner.java:909)
  at java.util.Scanner.next(Scanner.java:1530)
  at java.util.Scanner.nextInt(Scanner.java:2160)
  at java.util.Scanner.nextInt(Scanner.java:2119)
  at Tem.main(Tem.java:13)
  </code></pre>
  
  <p>Please Help</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Tem 
  
  {
  
      public static void main(String [] args) 
  
      { 
  
      Scanner scan = new Scanner(System.in); 
              String unit = ""; 
  
                  System.out.print("What is the outside Temperature: "); 
                   double temp = scan.nextDouble(); 
  
                  System.out.println("Type (C) for Celsius or (F) for Fahrenheit: "); 
                  int input = scan.nextInt();
  
                  if (input == 'F')
              { 
                      temp = (temp - 32) * 5/9.0; 
                      unit = "Celsius."; 
              }           
                  else if (input == 'C')
           { 
                  temp = (temp * 9/5.0) +32; 
                  unit = "Fahrenheit."; 
           }
  
      System.out.println("It is "+temp+" degrees "+unit);
  
      }
  
  }
  </code></pre>