Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need to Write a C++ program that inputs a single letter and prints out the corre

ID: 3620065 • Letter: N

Question

Need to
Write a C++ 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 digits correspond to either Q or Z. For these two letters, your program should print a message
indicating that they are not used on a telephone. If a letter in lower case or a non-alphabetic character is
entered, your program should indicate that there is no matching digit for such character.
The input of your program should be:
Please enter a single letter in upper case, and I will tell you what
the corresponding digit is on the telephone:
Examples of outputs are:
Supposing Z was entered: Sorry, but there is no digit on the telephone that corresponds to Z.
Supposing b was entered: Sorry, but b is an invalid input.
Supposing A was entered: The digit 2 corresponds to the letter A on the telephone.

Show that your program works by using at least 5 test cases, illustrating that all three cases listed above
are produced. You may only use the commands we have covered. That is, do not use looping for this
program.
Have your program send the output to both the screen and an output file. To have all the outputs appear
in the same output file, use the following to open the output file
outFile.open("hw2Output.txt", ios::app);
Note that you do not have to use the names outFile or hw2Output.txt .

Explanation / Answer

When declaring a char, be sure to put ' ' around the string. such as 'c'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote