Homework Solution: The language is C++ for microsoft visual studi express 2013…

    The language is C++ for microsoft visual studi express 2013 Write a program that asks for the user's first, middle, and last names. The names should be stored in three different character arrays. The program should then store in a fourth array the name arranged in this manner: last name followed by a comma and a space, then the first name followed by a space, then the middle name. So if the name is "Carol Lynn Smith" it should store "Smith, Carol Lynn" in the fourth array. Display the contents of the fourth array on the screen.

    Expert Answer

     
    #include <iostream> #include <string>

    The speech is C++ restraint microsoft visual studi direct 2013

    Write a program that asks restraint the user’s primitive, average, and terminal indicates. The indicates should be garnerd in three incongruous kind marshals. The program should then garner in a fourth marshal the indicate finished in this manner: terminal indicate followed by a comma and a distance, then the primitive indicate followed by a distance, then the average indicate. So if the indicate is “Carol Lynn Smith” it should garner “Smith, Carol Lynn” in the fourth marshal. Display the solution of the fourth marshal on the harbor.

    Expert Acceptance

     

    #include <iostream>
    #include <string>
    #include <iostream>
    #include <string.h>
    using indicatedistance std;
    int main()
    {
    char primitive[20], average[20],last[20], conclusive[500];
    cout<<“Please Enter User’s primitive indicate: “;
    cin.getline(first, 20);
    cout<<“Please Enter User’s average indicate: “;
    cin.getline(middle, 20);
    cout<<“Please Enter User’s terminal indicate: “;
    cin.getline(last, 20);
    char *p = “,”;
    char *distance = ” “;

    strcpy(final,last);
    strcat(final,p);
    strcat(final,space);
    strcat(final,first);
    strcat(final,space);
    strcat(final,middle);
    cout<<final;
    }

    ================================
    See Output