Write a Java program using while loop or do -while and switch to convert letters of the alphabet
into their corresponding digits on the telephone. The program should let the user enter letters from
A to Z. An error message should be printed for any nonalphabetic character that is entered. When
the & is entered, the program will be terminated.
The letters and digits on the telephone have the following correspondence:
ABC = 2
DEF = 3
GHI = 4
JKL = 5
MNO = 6
PQRS = 7
TUV = 8
WXYZ = 9

Write a Java program using while loop or do while and swi.pdf

  • 1.
    Write a Javaprogram using while loop or do -while and switch to convert letters of the alphabet into their corresponding digits on the telephone. The program should let the user enter letters from A to Z. An error message should be printed for any nonalphabetic character that is entered. When the & is entered, the program will be terminated. The letters and digits on the telephone have the following correspondence: ABC = 2 DEF = 3 GHI = 4 JKL = 5 MNO = 6 PQRS = 7 TUV = 8 WXYZ = 9