Question: in JAVA : Write an application that inputs a telephone number as a string in the form (555) 555-5555. The application should use String method

in JAVA: Write an application that inputs a telephone number as a string in the form (555) 555-5555. The application should use String method split to extract the area code as a token, the first three digits of the phone number as a token, and the last four digits of the phone number as a token. The seven digits of the phone number should be concatenated into one string. Both the area code and the phone number should be printed. Remember that you'll have to change delimiter characters during the tokenization process.

Here is expected output:

in JAVA: Write an application that inputs a telephone number as a

Please enter phone number in the format (888) 555-1212: (701)225-9620 Invalid input. Please enter phone number in the format (888) 555-1212: (701) 225-9620 Area Code: 701 Phone Number: 2259620

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!