| Telephone Digits |
Use capital letters only; ignore lower case; flag Z and other illegal inputs-- numbers, etc. Your algorithm should assume all inputs will be correct.
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.