Question: Ask the user to enter a product description as a sentence. If the user enters end or then end the program. Otherwise, parse the

Ask the user to enter a product description as a sentence.

If the user enters "end" or "" then end the program. Otherwise, parse the sentence into its component words, and do the following checks:

- Check that the first word is capitalized and that the sentence ends with a period. If not display a message.

- Check for any capitalized words in the sentence, other than the first word, and display those as names.

- Check for any words in the sentence that end with a period, and display those as abbreviations.

- Check the words to see if any contain both an open parentheses and a close parentheses and if so, display the text between them as the product code.

Extra Credit:

When the above checks are complete, ask the user for the next product description sentence.

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!