Question: complete the program according to the guide. thank you String Processing Objective: Learn how to - using string functions -- format output Problem: Write a


String Processing Objective: Learn how to - using string functions -- format output Problem: Write a program that repeatedly prompts the user to enter one line of a full name, each consisting of a first name, one or more middle names, and a last name, in that order, from keyboard. Then output the full name to the screen in the following format: the last name followed by a comma and then the first name; if the input full name includes one middle name, then output the middle name. If the input name has no middle name, then output NAN for middle name. You can assume that the user would not input more than three words. For example, if you enter John Henry Doe, the output should be Last name First name Middle name Doe, John Henry Requirements: Your program will quit if you input exit and will handle errors if you input nothing or only one word. You must use strepy_s() function to copy one string to the other and use strtok_s() to separate tokens. Suggested screen design: Enter your full name (exit to end): John Henry Doe Last name First name Middle name Doe, John Henry Enter your full name (exit to end): George Chen Last name First name Middle name Chen, George NAN Enter your full name (exit to end): You didn't input your name! Try again Enter your full name (exit to end) : Chen You need to enter your full name. Try again Enter your full name text to end : Donald Wacky Mouck Lastrame First name Middle name McDok, Donald Hacks Enter your full name exit to na Goodbye #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
