Lab 4

2/19/04

Task: Write a program that asks the user to enter a letter and returns the number on the telephone keypad that corresponds to the letter.

2 - ABC
3 - DEF
4 - GHI
5 - JKL
6 - MNO
7 - PQRS
8 - TUV
9 - WXYZ

If the user enters an invalid character, the program should print out an error message.

Use a function to look up the number

Purpose: The primary purpose of this program is to practice using if and functions.


Solution: