public void doOperation() throws ArithmeticException{
        if(testOperation()){
            BigDecimal result;
            switch (operation){
                case "X":
                    total = last.multiply(total).setScale(2, RoundingMode.HALF_UP);
                    last = null;
                    operation = null;
                    break;
                case "/":
                    total = last.divide(total, 2, RoundingMode.HALF_UP);
                    last = null;
                    operation = null;
                    break;
                case "+":
                    total = last.add(total).setScale(2, RoundingMode.HALF_UP);
                    last = null;
                    operation = null;
                    break;
                case "-":
                    total = last.subtract(total).setScale(2, RoundingMode.HALF_UP);
                    last = null;
                    operation = null;
                    break;
            }
        }
    }