Question: Write a program that will ask the user to enter a word or phrase. It will then repeatedly ask the user to enter combinations of

  1. Write a program that will ask the user to enter a word or phrase. It will then repeatedly ask the user to enter combinations of characters, and it will report whether that combination of characters can be extracted from the original word or phrase. To simplify things, assume that a letter can be used multiple times. For example, the word "tree" could be extracted from the word "credit", even though "e" appears only once in "credit". If the search string can be found in the original string, then indicate that. If it cannot be found in the original string, then identify a character that could not be found in the original string. Your program must operate exactly as shown in this demonstration: Write a program that will ask the user to enter a

Enter a word or phrase: Beach Bunny makes really great music. You can now enter combinations of characters, and I'll tell you if that combination can be found in the word you just entered. Enter character combination to find: cheer That combination can be extracted from the original. Again? y Enter character combination to find: reality That combination can be extracted from the original. Again? y Enter character combination to find: cheap That combination cannot be extracted. There is no 'p', for example. Again? n

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!