title: Basic Calculator
body: <p>Im having problems with my program. the program displays the first JOption message dialog box, but when you input a value, it fails to display the second dialog box??</p>
  
  <pre><code>import java.util.Scanner;
  import javax.swing.JOptionPane;
  
  public class javaCalculator 
  {
  public static void main(String[] args) 
  {
      int num1;
      int num2;
      String operation;
  
  
      Scanner input = new Scanner(System.in);
  
      JOptionPane.showInputDialog(null,"please enter the first number");
      num1 = input.nextInt();
  
      JOptionPane.showInputDialog(null,"please enter the second number");
      num2 = input.nextInt();
  
  
      JOptionPane.showInputDialog(null,"Please enter operation");
      operation = input.next();
  
      if (operation.equals ("+"))
      {
          JOptionPane.showMessageDialog(null,"your answer is" + " " + (num1 + num2));
      }
      if  (operation.equals ("-"))
      {
          JOptionPane.showMessageDialog(null,"your answer is" + " " + (num1 - num2));
      }
  
      if (operation.equals ("/"))
      {
          JOptionPane.showMessageDialog(null,"your answer is" + " " + (num1 / num2));
      }
      if (operation.equals ("*"))
      {
          JOptionPane.showMessageDialog(null,"your answer is" + " " + (num1 * num2));
      }
  
  
  }
  
  
  }
  </code></pre>