Question: Write a program that prompts the user for a first name, middle name and last name. Each name string is to be saved in its

Write a program that prompts the user for a first name, middle name and last name. Each name string is to be saved in its own character array. Then create a full name string by copying the first name to a fourth array, and concatenating (which means to append) the middle and last names (be sure when the full name string to separate each name string with some whitespace). Once the full name in its own buffer, display the total number of characters in the full name (not counting the blank space separators; for the sake of simplicity we won't worry about names that have embedded whitespace).

Finally, compare each of the name components to see if any of them are identical, and if they are, display an appropriate message to stdout. Perhaps some sample runs will clarify the expected output:

Run #1

Please enter your first name: Edward Please enter your middle name: Frank Please enter your last name: Edward Your full name is: Edward Frank Edward The total number of characters in your name is: 17 The first and last names are the same.

Run #2

Please enter your first name: Frank Please enter your middle name: Edward Please enter your last name: Edward Your full name is: Frank Edward Edward The total number of characters in your name is: 17 The middle and last names are the same.

Run #3

Please enter your first name: Frank Please enter your middle name: Frank Please enter your last name: Frank Your full name is: Frank Frank Frank The total number of characters in your name is: 15 The first and middle names are the same. The first and last names are the same. The middle and last names are the same.

Run #4

Please enter your first name: Frank Please enter your middle name: Michael Please enter your last name: Edward Your full name is: Frank Michael Edward The total number of characters in your name is: 18

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!