Question: Write a program to enter a text. Then enter a pattern and count the number of times the pattern is repeated in the text. Your

Write a program to enter a text. Then enter a pattern and count the number of times the pattern is
repeated in the text. Your program will read in a string not a character at a time.
Sample test Run 1(red user input) Provide your data for test run 2 and 3.
Enter string : She sells sea shells on the sea shore
Enter the pattern : sea
Pattern found 2 times
***Print Pattern not found if pattern is not found.

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 Programming Questions!