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
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