Question: Write a C++ program that reads a persons full name from the keyboard. The user can either input their name as first middle last or

Write a C++ program that reads a persons full name from the keyboard. The user can either input their name as first middle last or first last. Your program should then output their last name first followed by a comma, so either last, first middle or last, first respectively. (Note: You must ensure that regardless of which way the user enters, the program will proceed past your last cin line without any extra input.)

Example 1 input: Allie Funk Example 1 output: Funk, Allie 
Example 2 input: Jon Raymond Garbe Example 2 output: Garbe, Jon Raymond 

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!