public class SwitchDialPhoneExample
{
	public static void main(String args[])
	{
		// SwitchDialPhoneExample
		String phoneNumber = "1-800-GOJAVA";
		for (int i = 0; i < phoneNumber.length(); i++)
		{
			char letter = phoneNumber.charAt(i);
			switch (letter)
			{
				// Same code from Question c
				case 'A': case 'B': case 'C':
					System.out.print('2'); break;
				case 'D': case 'E': case 'F':
					System.out.print('3'); break;
				case 'G': case 'H': case 'I':
					System.out.print('4'); break;
				case 'J': case 'K': case 'L':
					System.out.print('5'); break;
				case 'M': case 'N': case 'O':
					System.out.print('6'); break;
				case 'P': case 'Q': case 'R': case 'S':
					System.out.print('7'); break;
				case 'T': case 'U': case 'V':
					System.out.print('8'); break;
				case 'W': case 'X': case 'Y': case 'Z':
					System.out.print('9'); break;
				default:
					System.out.print(letter);
			}
		}
		System.out.println();
	}
}
