title: Input/Output - Arithmetic Equation
body: <p>I am brand new to Java, started two weeks ago and am having issues wrapping my mind around this issue. I have a problem in a class I am taking that has been brought up before. Converting kilograms to pounds and rounding to the second decimal place. </p>
  
  <p>I can create the input side of things and bring up a dialog box to prompt the user to enter in a weight. I can also create an output that uses an equation I made to output the answer in a dialog box. </p>
  
  <p>My question is how do I take the information that is input and use it to convert from kilograms to pounds?</p>
  
  <p>I have been reading my book and scouring the internet trying to find an answer and I think I may be over thinking it. Thanks for the help.</p>
  
  <p><strong>Input.java</strong>:</p>
  
  <pre><code>//This program asks a user to input a weight in kilograms.
  
  package module2;
  
  import javax.swing.*;
  
  public class Input {
  
      public static void main(String[] args) {
  
          String weight;
  
          weight = JOptionPane.showInputDialog("Enter weight in kilograms");
      }
  }
  </code></pre>
  
  <p><strong>Output.java</strong>:</p>
  
  <pre><code>//This program outputs a converted weight from kilograms to pounds.
  
  package module2;
  
  import javax.swing.JOptionPane;
  
  public class Output {
  
      public static void main(String[] args) {
  
          double kg = 75.5;
          double lb = 2.2;
          double sum;
  
          sum = (kg * lb);
  
          JOptionPane.showMessageDialog(null,sum, "Weight Conversion", JOptionPane.INFORMATION_MESSAGE);
      }
  }
  </code></pre>