//Calculator.java //Application that inputs 2 numbers, outputs their sum, product etc. import javax.swing.*; //needed for JOptionPane public class Calculator { public static void main (String[] args) { String input; int num1; int num2; int sum, difference, product, quotient, remainder; input = JOptionPane.showInputDialog("Enter first integer"); num1 = Integer.parseInt(input); input = JOptionPane.showInputDialog("Enter second integer"); num2 = Integer.parseInt(input); sum = num1 + num2; difference = num1 - num2; product = num1 * num2; quotient = num1 / num2; remainder = num1 % num2; JOptionPane.showMessageDialog( null, "Sum is " + sum + "\nDifference is " + difference + "\nProduct is " + product + "\nQuotient is " + quotient + "\nRemainder is " + remainder); } }