fork download
  1. /* package whateve
  2.   String x = JOptionPane.showInputDialog("To ADD please Enter 1 \n"
  3.   + "To MULTIPLY please Enter 2 \n "
  4.   + "To Exist plaese Enter 3 \n");
  5.   int X = Integer . parseInt(x);
  6.   if (X==1) {
  7.   String y =JOptionPane.showInputDialog("Please enter the first number");
  8.   int Y = Integer .parseInt(y);
  9.   String z= JOptionPane.showInputDialog(" Please enter the second number");
  10.   int Z = Integer .parseInt(z);
  11.   int sum = Y+Z;
  12.   JOptionPane.showMessageDialog(null,"Result ="+ sum);
  13.   } else if (X==2) {
  14.   String a =JOptionPane.showInputDialog("Please enter the first number");
  15.   int A = Integer .parseInt(a);
  16.   String b= JOptionPane.showInputDialog(" Please enter the second number");
  17.   int B = Integer .parseInt(b);
  18.   int Res = A*B;
  19.   JOptionPane.showMessageDialog(null,"Result ="+ Res);
  20.   } else if (X==3) {
  21.   System.exit(X);
  22.   } else {
  23.   JOptionPane.showMessageDialog(null,"please Enter 1, 2 or 3");
  24.   }
  25.   }
  26.   r; // don't place package name! */
  27.  
  28. import java.util.*;
  29. import java.lang.*;
  30. import java.io.*;
  31.  
  32. /* Name of the class has to be "Main" only if the class is public. */
  33. class Ideone
  34. {
  35. public static void main (String[] args) throws java.lang.Exception
  36. {
  37. // your code goes here
  38. }
  39. }
Success #stdin #stdout 0.04s 320576KB
stdin
Standard input is empty
stdout
Standard output is empty