Question: Can someone tell me how to do this cpp question I copied the needed txt file : bad games.txt: john smith#165980076#8148337965#3rd & state st#erie#pa#16506 martin
Instructions As one of your first programming assignments at Mega Industries, you have been tasked with writing a program to read a file of names and addresses which was extracted from an obsolete system and display it in the new format. Many of the fields need to be edited. Atypical line in the old file would be: john smith# 165980076 8148337965 3rd & state stieriet pat 165065 it needs to be reformatted to: Smith, John, 165-98-0076, 814-833-7965,3rd & State St ,Erie, PA, 16506 After consulting with a senior programmer, you are suggested to organize your program with following functions: string fixName (string n); //takes in the name and returns it in the right format string fixSSN (string ss) //Fixes SSN string fix Phone (string ph) Fixes phone number string ress (string addr //Fixes fixAdd address string fixCity (string cty) Fixes city string fixstate (string st) Fixes state string extractField (string &s); Extracts a field (eg name) from the input string and then deletes //it and the octothorpe that follows it. The extracted field is //returned. Notice string s is passed by reference void buildLine (string &s, string field) Concatenates field and a comma to string The final result will be displayed like: Smith, John,165-98-0076,814-833-7965,3rd & State St,Erie,PA,16506 Gardner, Martin, 164-90-5543, 440-354-2700,5244 Heisley Rd, Mentor, OH,44123 Vendetti,Sarah,164-87-9987,330-254-1122,29 Millhaven St., Akron,OH,44532
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
