I am a total noob at programming. This is my first class ever. I can usually figure out Raptor if given enough time, but I have been working on this for a few days and I need help. I cannot for the life of me figure out how to output it in the correct format since the phone numbers can be entered in so many different ways. We were only given 1 sample chart and it had letters, not numbers. The assignment is as follows:
Many websites ask for phone numbers. The problem is that there are so many different 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 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.
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
Any help will be appreciated. Thank you in advance.
- Raptor Lab 9 Flowchart.rap
- Here is what I have so far.
- (14.96 KiB) Downloaded 17 times