Question: 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.

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

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!