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
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