Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java module called simplematch.java that contains a recursive function called 'match(String pattern, String word)', that can be used to determine if a
Write a Java module called simplematch.java that contains a recursive function called 'match(String pattern, String word)', that can be used to determine if a given pattern matches a given word. A pattern consists of letters and '?' wildcards. A '?' wildcard matches any letter at the corresponding position in the word. On the Vula page for this assignment you will find a program called testsimple.java that you can use to check your function. (The automatic marker will use this.) Sample I/O: Enter a pattern (or 'q' to quit): 1?ad Enter a word lead It's a match. Enter a pattern: le?d Enter a word led They don't match. Enter a pattern (or 'q' to quit): 1??d Enter a word lend It's a match. Enter a pattern (or 'q' to quit): q HINTS: I can think of three base cases. One is when both strings are empty. Another is when one is empty and the other is not. And the third is ... The palindrome function makes progress by 'eating' the characters at the ends of the string. This function makes progress by eating the first letter of each string.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here is the implementation of the simplematch module in Java java public class simplematch public st...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