title: Convert string to double in a dialog box
body: <p>I need help to understand the code.</p>
  
  <pre><code>public class ComputeLoanUsingInputDialog{
      public static void main(String[] args){
          String annulInterestRateString = JOptionPane.ShowInputDialog("Enter annual interest rate:")
  
          // convert string to double
          double annualInterestRate = Double.parseDouble(annualInterestRateString);
  
          //Obtain monthly interest rate
          double monthlyInterestRate = annualInterestRate/1200;
  
          .....
      }
  }
  </code></pre>
  
  <p>So my question is if you have a dialog box pop out to ask user to insert a number then why do you need to use parse method to convert the variable from string to double?</p>