Question
FILE: john smith#165980076#8148337965#3rd & state st#erie#pa#16506 martin gardner#164905543#4403542700#5244 heisley rd#mentor#oh#44123 sarah vendetti#164879987#3302541122#29 millhaven st.#akron#oh#44532 judy golumbiewski#194409976#7163347654#6187 fillmore ave#rochester#ny#07654 terry merz#193976554#8002435799#19876 elm avenue#manchester#mo#63166 kenisha jones#198432265#9193610419#902 east
FILE:
john smith#165980076#8148337965#3rd & state st#erie#pa#16506 martin gardner#164905543#4403542700#5244 heisley rd#mentor#oh#44123 sarah vendetti#164879987#3302541122#29 millhaven st.#akron#oh#44532 judy golumbiewski#194409976#7163347654#6187 fillmore ave#rochester#ny#07654 terry merz#193976554#8002435799#19876 elm avenue#manchester#mo#63166 kenisha jones#198432265#9193610419#902 east taylor rd#apex#nc#27709 phil yee#176409976#6308602682#1976 wacker drive#chicago#il#60191 jean caron#167453321#9738874700#1429 delben street#whippany#nj#07981 sandy alicea#176419006#3054428202#12 la habana east#miami#fl#33134 rob williams#206337765#3342715450#9854 fremont blvd#montgomery#al#36109 jancy hilfiger#201876987#8148817654#3012 state st#pittsburgh#pa#15011
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 write it out to a comma separated file. Many of the fields need to be edited. A typical line in the old file would be john smi th#165980076#8148337965#3rd & state st#erie#pa#16506 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 have a list of required functions as follows string fixName (string n) //takes in the name and returns it in the right frmat string fixSSN (string ss); //Fixes SSN string fixPhone (strinq ph): // Fixes phone number string fixAddress (string addr //Fixes address string fixcity(string ctz); // Fixes ci 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 octo thorpe (#) that follows it. Notice string s is //passed by reference void buildline(string &s, string ield); // Concatenates field and a comma to string sStep 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