Description
Many websites ask for phone numbers. The problem is that there are many ways to represent a phone number. Examples include 817-555-1234, 817 555 1234 (c), and (817) 555-1234 x23. Write a Raptor program which inputs a string containing a phone number in any format and outputs it in a standard format.
For this assignment, the standard format is ph: 817-555-1234 (note that there is a space between the: and first digit)
Your Raptor program should:
- Input a string including the number
- Copy only the digits from the input string into another string
- Issue an error message if the input string does not contain at least 10 digits
- If the input string contains more than 10 digits, include only the first 10 digits in the formatted number
- Output the phone number in standard format
Notes:
- In Raptor, a string is just an array of characters.
- Lesson #9 has an example of working with strings in Raptor.
- When only digits are input, Raptor assumes it is an integer instead of a string. Your flowchart does not need to properly handle an input like 8175551234, but your C++ version does need to handle that.
- I recommend passing the digits only string to a procedure which outputs it in the standard format.
Sample Output (inputs in bold)
Please enter a phone number: 817-555-1234
The properly formatted number is ph: 817-555-1234
Please enter a phone number: (817)515 7259 x23
The properly formatted number is ph: 817-515-7259
Please enter a phone number: 214-555-999
The phone number must have at least 10 digits
Please enter a phone number: 800* *4444xxx333
The properly formatted number is ph: 800-444-4333









