Scanner as an argument is not necessary here. I would suggest, in order, that you 1. Implementing something that works on simple binary operations. 2. Extend it to parse out those operations from string form. 3. Add in dialogue to interface with the user. 4. Take in command line arguments. Exceedingly Simple example that illustrates all 4 of the above: First an operator enumeration. public enum Operator { ADD('+'), SUBTRACT('-'), MULTIPLY('*'), DIVIDE('/'), MOD('%'), EXPONENTIATE('^'); private final char symbol; Operator(char symbol) { this.symbol = symbol; } public char symbol() { return symbol; } @Override public String toString() { return name().charAt(0) + name().substring(1).toLowerCase(); } } Then the calculator program itself. import java.util.Scanner; public class Calculator{ public static void main(String[] args) { if (args.length == 3) { System.out.println(calculate(args)); } else { Scanner input = new Scanner(System.in); System.out.print("Enter a binary calculation: "); System.out.println(calculate(input.nextLine().split("\\s+"))); } } private static double calculate(String[] args) { if (args.length != 3) { throw new IllegalArgumentException("Can only calculate binary operations"); } double input1 = Double.parseDouble(args[0]); char operator = args[1].charAt(0); double input2 = Double.parseDouble(args[2]); if (input2 == 0 && (operator == Operator.DIVIDE.symbol() || operator == Operator.MOD.symbol())) { throw new IllegalArgumentException("Cannot divide by 0"); } return calculation(input1, operator, input2); } private static double calculation(double input1, char operator, double input2) { double result = 0; switch(operator) { case '+': result = input1 + input2; break; case '-': result = input1 - input2; break; case '*': result = input1 * input2; break; case '/': result = input1 / input2; break; case '%': result = input1 % input2; break; case '^': result = Math.pow(input1, input2); break; } return result; } } If you're unfamiliar with the [split][1] function I'm simply converting whatever the user gives us to a String array, with the indexes separated by spaces (what the regex "\\s++" means). so I may treat it as if it was invoked from the command line. This example has **a lot** you can still improve on, including input validation and a more direct utilization of the enumeration among other things. Notice that I optionally directly accept argument which is something desirable for a CLI. [1]: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)