Question: Write in C++ 3. Write a program that inputs a first and last name, separated by a space, into a string variable. Use the string
Write in C++
3. Write a program that inputs a first and last name, separated by a space, into a string variable. Use the string functions to output the first and last initial. Embed your code into a do-while loop. At the end of the loop ask the user if he or she would like to repeat the program. Input the user's choice into a char using cin. If the character is 'y' then repeat the program, otherwise exit. Beware of the pitfall with newlines when cin is mixed with getline
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
