Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

<p>Write a program that read\'s in a person\'s name in the following format: fir

ID: 3633587 • Letter: #

Question

<p>Write a program that read's in a person's name in the following format: first name, then middle name or initial, and then last name. &#160;The program will the output &#160;the name in the following format: <br />Last_Name, First_Name Middle_Initial.</p>
<p><br />For example, the input<br />Mary Average User<br />should produce the following output:<br />User, Mary A.<br />The input :<br />Mary A. User<br />should also produce the same output.</p>
<p><br />Your program should work the same and place a period after the middle initial even if the input did not contain a period.</p>
<p>&#160;Your program should allow for user who give no middle name or middle initial. &#160;In that case, the output, of course, contains no middle name or middle initial. &#160;For example:<br />The input:<br />Mary User<br />should output:<br />User, Mary<br />Please use C++ - strings for this assignment, not C-Strings.</p>

Explanation / Answer

#include #include using namespace std; // ==================== // main function // ==================== int main() { // // Variable declarations // string first, second, third; // strings read in char ch; // character in input after second string char middleInitial; // // Get the first two strings read in (first and middle names or // first and last names) cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote