Description
The purpose of this challenge is to manually manipulate character arrays. This challenge converts text in phone numbers to their equivalent values on a phone keypad.
Requirements
- Write a program to decode phone numbers with letters in them.
- Create a void function decodetext(char after[], char before[]). This function should be case-insensitive. Do NOT cout in this function. The after array represents the phone number with only numbers. The before array represents the phone number with some text.
- Declare a char array to hold a maximum of 50 characters to receive the user input.
- Ask the user to enter a string. Use cin.getline(input, 50) function call to get the string from the user.
- Make sure to ignore (don’t decode) dashes in the string.
- Show the decoded phone number
- You may need to write other functions to make your code easier. It’s up to you.
Sample Interaction / Output
Enter a phone number: 800-555-HELP 800-555-HELP is actually 800-555-4357 Enter a phone number: ABC-DEF-GHI-JKL-MNO-PQRS-TUV-WXYZ ABC-DEF-GHI-JKL-MNO-PQRS-TUV-WXYZ is actually 222-333-444-555-666-7777-888-9999
LEGEND
PROGRAM OUTPUT
USER INPUT
FROM INPUT
CATALOG ID: CPP-CHAL0012
Print Requirements