how would you write a program that translates an alphabetic phone number into numeric form

enter phone number: CALLATT
2255288

Thank you for using the Jiskha Homework Help Forum.

Here are links about existing programs: http://www.freepatentsonline.com/7065385.html

http://www.freepatentsonline.com/20040198244.html

To write a program that translates an alphabetic phone number into numeric form, you can follow the steps below:

1. Create a dictionary that maps each alphabet character to its corresponding numeric value. For example:

```
mapping = {'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3', 'f': '3', 'g': '4', 'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l': '5', 'm': '6', 'n': '6', 'o': '6', 'p': '7', 'q': '7', 'r': '7', 's': '7', 't': '8', 'u': '8', 'v': '8', 'w': '9', 'x': '9', 'y': '9', 'z': '9'}
```

2. Prompt the user to enter an alphabetic phone number.

3. Iterate through each character of the entered phone number and convert it to its corresponding numeric value using the dictionary created in step 1. Append each converted character to a new string.

4. Display the final numeric phone number to the user.

Here's an example program in Python:

```python
mapping = {'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3', 'f': '3', 'g': '4', 'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l': '5', 'm': '6', 'n': '6', 'o': '6', 'p': '7', 'q': '7', 'r': '7', 's': '7', 't': '8', 'u': '8', 'v': '8', 'w': '9', 'x': '9', 'y': '9', 'z': '9'}

phone_number = input("Enter phone number: ").lower()

numeric_phone_number = ""
for char in phone_number:
if char.isalpha():
numeric_phone_number += mapping[char]
else:
numeric_phone_number += char

print("Numeric phone number:", numeric_phone_number)
```

When you run the program and enter an alphabetic phone number like "CALLATT", the program will output "2255288", which is the numeric form of the phone number.