Question: You are beginning to work on a problem that needs to output names in several formats along with the corresponding Social Security number. Therefore, you
You are beginning to work on a problem that needs to output names in several formats along with the corresponding Social Security number. Therefore, you need to create a C++ program which reads in a Social Security number, a first name, a middle name or initial, and a last name from the file inData.dat. The name is written to file outData.dat in three different formats:
Format 1: First name, middle name, last name, and Social Security number Format 2: Last name, first name, middle name, and Social Security number Format 3: Last name, first name, middle initial, and Social Security number Format 4: Last name, middle initial, last name
Note: The social security number and name in three parts on file inData.dat, each separated by one or more whitespaces characters:
222-33-3543 Robert James Williams
Output: Write data in file outData.dat with proper format:
Robert James Williams 222-33-3543
Williams, Robert, James 222-33-3543
Williams, Robert, J. 222-33-3543
Robert J. Williams
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
