Answered step by step
Verified Expert Solution
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 HernadezSmith Unacceptable names would be Mke
The second line of each entry should be a phone number with area code. Acceptable phone numbers would be Unacceptable phone numbers would be or
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 commandline 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
Elm St Apt B
Springfield,
Judy Smth
Lavender St
Dupo, TX
Emily JohnsonSmith
County Rd
Oakdale Center, TX
Thurston T Howell, III
Indian Summer
TX
William Brown
RR
Ruralville, TX
Wesley McKay
Grant St
Rosenberg, TX
gooddata.txt
James J Smith
Elm St Apt B
Springfield, TX
Judy Smith
Lavender St
Dupo, TX
Emily JohnsonSmith
County Rd Apt
Oakdale Center, TX
Thurston T Howell, III
Indian Summer Rd
Richardson, TX
William Brown
RR Box A
Ruralville, TX
Wesley McKay
Grant St
Rosenberg, TX
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started