Welcome
Welcome to raptorflowchart

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Raptor Flowchart string phone number format

Discuss and share code here. Working on something that you can't get right - post it here.

Raptor Flowchart string phone number format

Postby darthstix » Thu Apr 20, 2017 5:46 pm

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.
Attachments
Raptor Lab 9 Flowchart.rap
Here is what I have so far.
(14.96 KiB) Downloaded 22 times
darthstix
 
Posts: 2
Joined: Tue Apr 18, 2017 4:37 pm

 

Re: Raptor Flowchart string phone number format

Postby transformer8302 » Sat Apr 22, 2017 3:53 pm

Not sure if you have figured this assignment out yet but attached is how far i have gotten on the same assignment. I keep getting an error when trying to assign the number to a numbers only string at the end of loop. I will keep working on it and hopefully I can figure out soon. I hope this helps and if you or anyone else can help where I am going wrong that would be greatly appreciated.
Attachments
Phone Numbers.rap
(20.08 KiB) Downloaded 16 times
transformer8302
 
Posts: 1
Joined: Sat Apr 22, 2017 3:48 pm

Re: Raptor Flowchart string phone number format

Postby darthstix » Sat Apr 22, 2017 8:05 pm

I have not figured it out yet. I got a little further, but it still doesn't output correctly and I cannot enter the 214 555 9999 (c) or the 800**4444xxx333 in the sample output without it giving me an error message.

Thank you for your help. I understand the C++ part of my class, but not Raptor as well. Any help is very much appreciated.

Attached is my revised.
Attachments
Raptor Lab 9 Flowchart.rap
My revised. Still not working.
(49.7 KiB) Downloaded 20 times
darthstix
 
Posts: 2
Joined: Tue Apr 18, 2017 4:37 pm


Return to RAPTOR programming discussions

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred