Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I NEED A C++ CODE! Many websites ask for phone numbers. The problem is that there are many different ways to represent a phone number.

I NEED A C++ CODE!

Many websites ask for phone numbers. The problem is that there are many different ways to represent a phone number. Examples include 817-555-1234, 817 555 1234 (c), and (817) 555-1234 x23. Write a C++ program which inputs a string containing a phone number in any format and outputs it in the standard format. Your program may use either C-Strings or the C++ string Class, but should not mix them. For this assignment, the standard format is (817) 555-1234.

Sample Output (inputs in bold)

1. Please enter a phone number: 817-555-1234 The properly formatted number is (817) 555-1234

2. Please enter a phone number: (817)515 7259 x23 The properly formatted number is (817) 515-7259

3. Please enter a phone number: 214-555-999 The phone number must have at least 10 digits

4. Please enter a phone number: 800**4444xxx333 The properly formatted number is (800) 444-4333

Thank you.

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

Step: 3

blur-text-image

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago