Some coding corrections
Use Integer.parseInt instead of Scanner.nextInt