Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 (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 at least 10 digits 4. If the input string contains more than 10 digits, indude only the first 10 digits in the formatted number 5. Output the phone number in standard format 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 Notes: 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 properly formatted number is (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* 4444xx1333 The properly formatted number is (800) 444.4333

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago

Question

Define Management or What is Management?

Answered: 1 week ago

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago