Question: Write a Java program which will take the name of the file as a command - line prompt and validate the data. If there are

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

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!