Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java For this assignment question, write a program which will get the personal alphabetic telephone numbers from a text file and store them in an

Java

For this assignment question, write a program which will get the personal alphabetic telephone numbers from a text file and store them in an array list called alphabeticPhoneNumbers. If the number of the characters is not between 12 and 14, inclusively and there is any other character besides a-z or A-Z, or -, or 0-9 in a record, those should be flagged as ill-defined data. This ill-defined data needs to remove from the original array list and move it to another array list called errorProneNumbers. In other words, error involving records should be saved in a separate array list. If there no error in the data, it needs to be translated to its numeric equivalent to store it in another array list that is called equivalentPhoneNumber.

At the end application should display the array list that has the telephone number with alphabetic characters, and the list that has their numeric equivalent, and the list that has data (alphabetic phone number) with error.

For example, when the program reads 555-GET-FOOD from the original list, its equivalent 555-438-3663 needs to be stored into the list equivalentPhoneNumber. When it reads 222-ASK-???? from the original list, this error prone data needs to move to the list errorProneNumbers.

On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion;

A, B and C = 2

D, E, and F = 3

G, H, and I = 4

J, K, and L = 5

M, N, and O = 6

P, Q, R, and S = 7

T, U, and V = 8

W, X, Y, and Z = 9

Hint: Your program should display the result as shown in below

Original Data with no-error:

[1-800-FLOWERS 1-800-GOT-JUNK 555-GET-FOOD 1-800-PET-MEDS 1-800-LAWYERS 1-800-GO-FONTS 713-333-MOVE]

Numeric Phone Numbers:

[1-800-3569377 1-800-468-5865 555-438-3663 1-800-738-6337 1-800-5299377 1-800-46-36687 713-333-6683]

Error Prone Alphabetic Numbers:

[222-ASK-???? 1800/GET-CAKE]

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago