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

This is the skeleton of the program...does anyone know how to flesh it out? Than

ID: 3646792 • Letter: T

Question

This is the skeleton of the program...does anyone know how to flesh it out?

Thanks...


Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have three letters associated with them, as is indicated by the following table:

Digit Letter
2 A B C
3 D E F
4 G H I
5 J K L
6 M N O
7 P R S
8 T U V
9 W X Y

Many people find it difficult to memorize phone numbers, so they use the correspondence between digits and letters to develop seven-letter words that correspond to their phone numbers. For example, a person whose telephone number is 378-6653 might use the correspondence indicated in the above table to develop the sevenletter word

Explanation / Answer

#inlcude #include using namespace std; int main() { //I know that the numbers '9' and '7' have four letters, but I'd rather not create a //two-dimensional array with the dimensions of 8 * 4 and waste space char Number_Letter[8][3] = {{'A', 'B', 'C'}, {'D', 'E', 'F'}, {'G', 'H', 'I'}, {'J', 'K', 'L'}, {'M', 'N', 'O'}, {'P', 'Q', 'R'}, {'T', 'U', 'V'}, {'W', 'X', 'Y'}}; //We have a to initialize the char array "Number_Name" with 8 elements since // the terminator is stored in the last element char Number_Name[8]; int Final_Number[7]; cout > Number_Name; //We have to capitalize the char array "Number_Name" to be able to make comparisons //with the "Number_Letter" array. The "toupper" function is defined in the cctype library. Number_Name = toupper(Number_Name); for (int Index = 0, Name = 0; Index < 8, Name < 7; Index++) { for (int Letter = 0; Letter < 3; Letter++) { if (Number_Name[Name] == Number_Letter[Index][Letter]) { Final_Number[Name] = Index + 2; Name++; Letter = 0; } if (Number_Name[Name] == 'S') { Final_Name[Name] = 7; Name++; Letter = 0; } if (Number_Name[Name] == 'Z') Final_Name[Name] = 9; Name++; Letter = 0; } } } cout
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