Question: Write a Raptor program (in simply terms, so that I can understand, I'm a beginner) which inputs a string containing a phone number in any
Write a Raptor program (in simply terms, so that I can understand, I'm a beginner) which inputs a string containing a phone number in any format and outputs it in the standard format. For this assignment, the standard format is (817) 555-1234.
Your Raptor program should:
1. Input a string including the number
2. Copy only the digits from the input string into another string
3. Issue an error message if the input string does not contain exactly 10 digits
4. Output the phone number in standard format
Notes: 1. In Raptor, a string is just an array of characters.
2. Lesson #9 has an example of working with strings in Raptor.
3. 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.
4. 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 (817) 555-1234
Please enter a phone number: (817)515 7259 x23 The phone number must have 10 digits
Please enter a phone number: 214 555 9999 (c) The properly formatted number is (214) 555-9999
Please enter a phone number: 800**4444xxx333 The properly formatted number is (800) 444-4333
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
