Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Mia_Michelle {
- static public void main(String[] args) {
- //Get input from user using JOptionPane
- int firstNum = Integer.parseInt(JOptionPane.showInputDialog("Enter first integer: "));
- int secondNum = Integer.parseInt(JOptionPane.showInputDialog("Enter second integer: "));
- String message = "First integer inputted is "+firstNum+" and the second integer inputted is "+secondNum;
- int sum = firstNum+secondNum;
- JOptionPane.showMessageDialog(null, "First integer inputted is "+firstNum+" and the second integer inputted is "+secondNum);
- JOptionPane.showMessageDialog(null, "The sum of two integer is: "+sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment