header

Homework 10

This is a modification of Homework 7.

Output Requirements

For each letter in a sequence of letters, display the corresponding telephone numeral. The sample run below indicates what your program should look like when it executes.

Given a sequence of letters, this application will find the
corresponding digits on the telephone.

Enter a sequence of letters: Asbury

The letter A corresponds to the numeral 2
The letter s corresponds to the numeral 7
The letter b corresponds to the numeral 2
The letter u corresponds to the numeral 8
The letter r corresponds to the numeral 7
The letter y corresponds to the numeral 9


Press Enter to return to Quincy...

Input Requirements

A sequence of letters (either uppercase or lowercase). The user will enter the letters all at once on the same line. You may not assume that the user enters only letters of the alphabet.

Processing Requirements

Each of the numerals '2' through '9' in a telephone "number" corresponds to three or four letters of the alphabet as shown below. For each letter entered by the user, your program should determine the corresponding numeral.

Miscellaneous Requirements

You are to implement and use a value-returning function named "numeral". This function accepts one parameter (a char type variable) and returns a char type result. The value returned by this function is the telephone numeral that corresponds to the letter of the alphabet passed in as the function parameter. If the character parameter is anything but a letter of the alphabet, this function should return the asterisk character (*).