import java.util.Scanner; public class Main2 { public static void main(String [] args) { Scanner in = new Scanner(System.in ); System.out.println("Enter a letter:"); String input = in.nextLine(); if (input.length() == 1 && Character.isLetter(input.charAt(0))) { char a = input.toUpperCase().charAt(0); if (a >= 'A' && a <= 'C') { System.out.println("The corresponding number is 2"); } else if (a >= 'D' && a <= 'F') { System.out.println("The corresponding number is 3"); } else if (a >= 'G' && a <= 'I') { System.out.println("The corresponding number is 4"); } else if (a >= 'J' && a <= 'L') { System.out.println("The corresponding number is 5"); } else if (a >= 'M' && a <= 'O') { System.out.println("The corresponding number is 6"); } else if (a >= 'P' && a <= 'S') { System.out.println("The corresponding number is 7"); } else if (a >= 'T' && a <= 'V') { System.out.println("The corresponding number is 8"); } else if (a >= 'W' && a <= 'Z') { System.out.println("The corresponding number is 9"); } } else { System.out.println(" error"); } in.close(); } }