Question: c++ Write a function that receives a name in any of the formats in the original data and returns a name in the specified format.

c++

Write a function that receives a name in any of the formats in the

original data and returns a name in the specified format. The

name is to written in first middle last format. Middle names are optional and it is possible to have multiple middle

names. Here are some examples of the

specified format.

Bilbo Baggins

Jessica Peterson

Caroline B. Wartleton

Connor William Harold Jones

In the original data,the names can be in any of the following formats.

None of the original names are in any other format than the ones

listed below.

last, first

first last

first middle last

last, first middle

Examples

Baggins, Bilbo

Jessica Peterson

Caroline B. Wartleton

Jones, Connor William Harold

Add the function prototype in the `directories.h` file.

std::string FixName(std::string name);

Write the function definition in the `directories.cpp` file.

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!