title: Can't enter double variable
body: <pre><code>import java.util.Scanner;
  
  
      public static void main(String[] args)
      {
          //Interest rate,number of years,loan amount; display the monthly total payments
  
  
  
          Scanner input = new Scanner(System.in);
          //Ask for interest rate
          System.out.println("Enter your interest rate : ");
  
  
          //Get interest rate
          double interestRate = input.nextDouble();
  
          //Ask number of years
          System.out.println("Enter the number of years for this loan : ");
  
  
          //Get number of years
          double numberOfYears = input.nextDouble();
  
          //Ask for loan amount
          System.out.println("Enter your loan amount : ");
          //Get loan amount
          double loanAmount = input.nextDouble();
  
  
          //Monthly interest rate
          double monthlyInterestRate = interestRate / 12;
  
          //Monthly payment
          double monthlyPayment = (loanAmount * monthlyInterestRate) /
                  1 - 1 / Math.pow(1 + monthlyInterestRate, numberOfYears*12)
                  ;
  
          //Total payment
          System.out.println("total payment is : " + monthlyPayment * 12 * numberOfYears);
      }
  </code></pre>
  
  <p>When I enter a interest rate as my first input, for example <code>2.5</code> or <code>2.0</code> it gives</p>
  
  <pre><code>Exception in thread "main" java.util.InputMismatchException
          at java.util.Scanner.throwFor(Unknown Source)
          at java.util.Scanner.next(Unknown Source)
          at java.util.Scanner.nextDouble(Unknown Source)
          at Sal.main(Sal.java:17)
  </code></pre>
  
  <p>I put in double variable, it wants integer. I don't understand. And yes I did import Scanner and type my class. I bought my computer 1 week ago. Same code should work fine because it was from my exercise book.</p>