Question: Write a program for A Pattern Matching Problem (henceforth referred as PattMatch). Your program should take two inputs (both are string) - 1. Pattern 2.

 Write a program for A Pattern Matching Problem (henceforth referred as

Write a program for A Pattern Matching Problem (henceforth referred as PattMatch). Your program should take two inputs (both are string) - 1. Pattern 2. Name Your program should determine whether Name matches Pattern. It produces output "MATCHED" if Name Matches Pattern otherwise it produces "NOT MATCHED" Pattern consists of characters a-3, A-Z,* and ?. Among these and ? are wild card characters. The character * means or matches with zero or more characters. The character ? means or matches with exactly one character. Few examples of Pattern and their meaning is given in following table - Pattern Ad Meaning Any string beginning with Ad, or Ad followed by zero or more characters Any string of length 3 characters and ending with p Any string of length two or more characters ?? ??* Few examples of program input and output are as given below- Program Input Program Output Pattern Name Ad Ad* ??p ??p Adgy Aqui drp wsy MATCHED NOT MATCHED MATCHED NOT MATCHED Write a program for a pattern matching problem described in above. This is to be done in C++. But you can't use any library function related with regular expression and character matching

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!