I'm creating a calculator but I need help. The user is supposed to write for example 2+2 and get the answer 4 in a dialogue window but I'm stuck on how to make it work.
here is my codeString s = JOptionPane.showInputDialog(null, "Type in number"); int num = Integer.parseInt(s); ArrayList<String> matte = new ArrayList<String>(); matte.add("+"); matte.add("-"); matte.add("/"); matte.add("*"); matte.get(0); System.out.println(matte);