Question
Accept user input of a name string. Verify that the name string contains a first name and a last name and that both contain valid
Accept user input of a name string. Verify that the name string contains a first name and a last name and that both contain valid name characters and are from 2 to 20 characters in length. The name string may optionally contain a middle name or middle initial. The name string may also optionally contain a leading salutation or title (Mr., Mrs., Miss, Dr.). Allowable titles should be pre-defined.
Determine whether a valid name string has been entered. If not, indicate why. If so, identify and display each part of the name. In any case, the program should continue to ask the user for a name string until the user enters "end".
Extra extra credit; allow of a suffix, such as Jr, II, III, ... . Like the salutations, the allowable suffixes should be predefined.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started