Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The first line of each entry should be a name. For this assignment, legal names are anything that do not contain digits. So for example,

The first line of each entry should be a name. For this assignment, legal names are anything that do not contain digits. So for example, acceptable names would be John SmithQuincy Q. Adams, III, and Matha Hernadez-Smith. Unacceptable names would be M1ke0.
The second line of each entry should be a phone number with area code. Acceptable phone numbers would be (204)250-2850,(936)678-1785. Unacceptable phone numbers would be 168-2876 or (910)2678-269.
The third line of each entry should be a street address.
Write a Java program which will take the name of the file as a command-line prompt and validate the data. If there are no errors, your program should output the number of records processed. If there are errors, you should print the name of the person with the error, and a clear message about which line contained the problem. After validation, output the number of records which had at least one error and the number which were correct.
Baddata.txt
James J Smith
964-2826
123 Elm St Apt 4B
Springfield, 6271
Judy Sm1th
(713)926-6343
100 Lavender St
Dupo, TX 62239
Emily Johnson-Smith
(409)8648-0383
456 County Rd 123
Oakdale Center, TX 37829
Thurston T. Howell, III
(979)239-7690
344 Indian Summer
TX 75081
William Brown
(956)251-1347
RR 7
Ruralville, TX 75234
Wesley McKay
(512)241-6166
29 Grant St
Rosenberg, TX
gooddata.txt
James J Smith
(512)964-2826
123 Elm St Apt 4B
Springfield, TX 62701
Judy Smith
(713)926-6343
100 Lavender St
Dupo, TX 62239
Emily Johnson-Smith
(409)868-0383
456 County Rd Apt 123
Oakdale Center, TX 37829
Thurston T. Howell, III
(979)239-7690
344 Indian Summer Rd
Richardson, TX 75081
William Brown
(956)251-1347
RR 7 Box 2A
Ruralville, TX 75234
Wesley McKay
(512)241-6166
29 Grant St
Rosenberg, TX 77471

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions