Telephone Digits

1. Write a pseudocode algorithm that reads a letter and prints the corresponding digit on the telephone. You may adopt the following simplfying assumptions:

Use capital letters only; ignore lower case; flag Z and other illegal inputs-- numbers, etc. Your algorithm should assume all inputs will be correct.

I/O Spec.

     Enter a single capital letter (c-d to quit): A
     letter A. digit: 2
     Enter a single capial letter (c-d to quit): X
     letter X. digit: 9
     Enter a single capital letter (c-d to quit): Z
     letter Z. no corresponding telephone digit
     Enter a single capital letter (c-d to quit): !
     letter !. no corresponding telephone digit
     Enter a single capital letter (c-d to quit): control-d
     Exiting...
2. Use the logic of your algorithm to define the following function:
/* telDigit() -----------------------------------
 * returns the telephone digit corresponding to ch
 */
int telDigit(char ch);
Remember: telDigit() does not use cout and cin.

3. Test telDigit(): write a program, telDigit.cpp, that meets the I/O spec. given above. The driver function, main(), does the I/O.