Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Design a class named LanguageRecognizerG to implement a language recognizer. The LanguageRecognizerG class must accept strings from the user, and determine recursively (method recursiveRecogG)
1. Design a class named LanguageRecognizerG to implement a language recognizer. The LanguageRecognizerG class must accept strings from the user, and determine recursively (method recursiveRecogG) whether the string is a word of the G language. The G language has the following grammar: The client program (exterior to your class) will read the word from the keyboard as follows: Enter the G-language word to check: Suppose that the user enters the word: The client program will then proceed to create an object of your class with the user entered word and check with one simple call of a method. The client program should not implement any result printing at all. That is the responsibility of your class via its methods. A client program is provided on Page 4. Feel free to use it for your tests! The output should appear as follows: Recursion : Word ###" S NOT a word of the G language If the entered word is #A instead, the output would be: Recursion: Word #A" IS a word of the G language
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