Question: Instructions The program Telephone Digits outputs only telephone digits that correspond to uppercase letters. Rewrite the program so that it processes both uppercase and

Instructions The program Telephone Digits outputs only telephone digits that correspond to uppercase letters.****// I 2 // Program: Telephone Digits 3 // This is an example of a sentinel-controlled loop. This 4 //26 27 28 283 29 30 31 32 33 34 35 36 37 38 39 40 1 Q 43 44 45 46 47 48 49 42 46 while (letter != '#') { cout50 51 52 53 54 55 56 -57 58 59 60 61 62 } cout < <

Instructions The program Telephone Digits outputs only telephone digits that correspond to uppercase letters. Rewrite the program so that it processes both uppercase and lowercase letters and outputs the corresponding telephone digit. If the input is something other than an uppercase or lowercase letter, the program must output an appropriate error message (The error message should contain the phrase Invalid input). ****// I 2 // Program: Telephone Digits 3 // This is an example of a sentinel-controlled loop. This 4 // program converts uppercase letters to their corresponding 5 // telephone digits. 6 //***** 7 #include 8 9 using namespace std; 10 11 int main() 12 { 13 14 15 16 17 34 FREE 18 19 20 21 22 23 24 25 char letter; int digit, num; cout < < "Program to convert uppercase letters to < < "their corresponding telephone digits." < < endl; cout < < "To stop the program enter #." < < endl; cout < > letter; cout < < endl; 11 26 27 28 283 29 30 31 32 33 34 35 36 37 38 39 40 1 Q 43 44 45 46 47 48 49 42 46 while (letter != '#') { cout < < "Letter: " < < letter; cout < < ", Corresponding telephone digit: "; num = static_cast (letter) static_cast ('A'); if (0 50 51 52 53 54 55 56 -57 58 59 60 61 62 } cout < > letter; cout < < endl; } //end while return 0;

Step by Step Solution

3.50 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can modify the program to handle both uppercase and lowercase letters and output the correspondi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!