Overview: Invalid input of letter will not be checked Step to reproduce: 1) Start the calculator 2) Enter a 3) Press Enter Expected Result: error message of invalid input. Actual Result: no response Build Date & Hardware: 07-11-2020 on Window 10.0.18363
problem is using "while(!sc.hasNextInt())". It ignore all character and noway to show the problem input to user. solution is edit the code from: while (!sc.hasNextInt()) sc.next(); int input = sc.nextInt(); sc.nextLine(); return input; to: String input = sc.nextLine(); try { int option = Integer.parseInt(input); return option; } catch (NumberFormatException e) { throw new InvaildInputOptionException(String.valueOf(input)); }