Question: C++ Write a program that reads in a series of names from a file The file is called numbers.txt. It uses a loop to read

C++

C++ Write a program that reads in a series of names from

Write a program that reads in a series of names from a file The file is called numbers.txt. It uses a loop to read in each number from the file and store each number in an array called numbers. The program should then call two functions. The first function: The function is named formatSSN It take in a string variable by reference It alters the string to be a properly formatted social security number, in the format XXX-XXX-XXXX This function must use the substring function. It returns nothing. The second function: The function is named print It takes in an array of strings and an integer for the size of the array. It prints out the array using a for loop to the console It returns nothing The program will use a loop to call the formatSSN function on each of the strings in the numbers array. Once all of the strings are converted to a formatted social security number, call the print function to display each of the capitalized names. Copy and paste the starter code below into a new file called social.cpp/* Name * Section info */#include #include #include using namespace std; void formatSSN(strings number);//converts a string to a formatted social security number void print (string numbers[], int. SIZE.);//printe the contents of an array int main() {//write the program, logic here//write your functions here Copy and paste the below data into a file called numbers.txt: 55566777 3334445555 1118884949 3332225678 1234445555 8889990000 1116664343 2224563333 1112229999 4568899393 Below is the output that your program should give: 555-66-6777 333-44-4555 111-88-8494 333-22-2 567 123-44-4555 888-99-9000 111-66-6434 222-45-5333 111-22-2999 456-88-9939

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!