I don't know what I am missing.
Help me.
import javax.swing.*;
import java.util.Scanner;
public class Operator {
public static void main(String args[])
{
String num1,num2,op;
int ans;
Scanner cin = new Scanner(System.in);
num1 = JOptionPane.showInputDialog("Enter First Number");
op = JOptionPane.showInputDialog("Enter Operator");
num2 = JOptionPane.showInputDialog("Enter Second Number");
char c = (char) Integer.parseInt(op);
int fnum = Integer.parseInt(num1);
int snum = Integer.parseInt(num2);
switch(c)
{
case '+':
ans = fnum + snum;
JOptionPane.showMessageDialog(null,"Answer" + ans);
break;
case '*':
ans = fnum * snum;
JOptionPane.showMessageDialog(null,"Answer" + ans);
break;
case '-':
ans = fnum - snum;
JOptionPane.showMessageDialog(null,"Answer" + ans);
break;
case '/':
ans = fnum/snum;
JOptionPane.showMessageDialog(null,"Answer" + ans);
break;
default:
JOptionPane.showMessageDialog(null, "Wrong Operator");
}
}
}