Write a C++ function that receives a single letter and prints out the correspond
ID: 3650148 • Letter: W
Question
Write a C++ function that receives 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 3 = DEF 4 = GHI 5 = JKL 6 = MNO 7 = PRS 8 = TUV 9 = WXY No digit corresponds to either Q or Z. For these 2 letters your program should print a message indicating that they are not used on a telephone. The program may operate like this: Enter a single letter and you will get the corresponding digit on the telephone: R The digit 7 corresponds to the letter R on the telephone Another example: Enter a single letter and you will get the corresponding digit on the telephone: Z There is no digit on the telephone that corresponds to Z NOTE: Your program should accept only uppercase letters (error message for special characters or lowercase letters) Program: Write a program that consists of a main function and the function described above. Read in letters in the main function and call the function to print a corresponding message. It should repeat to do so until a symbolExplanation / Answer
//SLIGHT CHANGE. NEWER VERSION #include #include using namespace std; /* Write a C++ function that receives 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 3 = DEF 4 = GHI 5 = JKL 6 = MNO 7 = PRS 8 = TUV 9 = WXY No digit corresponds to either Q or Z. For these 2 letters your program should print a message indicating that they are not used on a telephone. The program may operate like this: Enter a single letter and you will get the corresponding digit on the telephone: R The digit 7 corresponds to the letter R on the telephone Another example: Enter a single letter and you will get the corresponding digit on the telephone: Z There is no digit on the telephone that corresponds to Z NOTE: Your program should accept only uppercase letters (error message for special characters or lowercase letters) Program: Write a program that consists of a main function and the function described above. Read in letters in the main function and call the function to print a corresponding message. It should repeat to do so until a symbol “$” is read. Submit your program and the output produced*/ void print(char); int main(){ char wait,input; do{ coutinput; while((input'Z')&& input!='$'){ coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.