Write a program that inputs a single letter and prints out the corresponding dig
ID: 441585 • Letter: W
Question
Write a program that inputs a single letter and prints out the corresponding digit on the telephone. The letters
and digits on a telephone are grouped this way:
2 = ABC 4 = GHI 6 = MNO 8 = TUV
3 = DEF 5 = JKL 7 = PRS 9 = WXY
No digit corresponds to either Q or Z. For these two letters, your program should print a message indicating
that they are not used on a telephone.
The program might operate like this:
Enter a single letter, and I will tell you what the corresponding digit is on the telephone.
R
The digit 7 corresponds to the letter R on the telephone.
Here's another example:
Enter a single letter, and I will tell you what the corresponding digit is on the telephone.
Q
There is no digit on the telephone that corresponds to Q.
Your program should print message indicating that there is no matching digit for any nonalphabetic character
the user enters. Also, the program should recognize only uppercase letters. So, the lowercase letters are
invalid characters. Prompt the user with an informative message for the input value, as shown above. The
program should echo-print the input letter as part of the output.
Explanation / Answer
please rate - thanks #includeusing namespace std; int main() { char c; coutc; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.