Write a GUI program which incorporates a try-catch block to error check your input for integers and alphabetic characters other than Y or N. Your program must include two interactions. Each interaction will ask the user at least two questions, both of which require a yes/no response (Y or N). The program flow will depend on both user responses. Your program must include at minimum an OK and Exit button. You cannot have a Yes/No button as the user must be able to type Y or N in the GUI. See the document below for more information:
I will explain how the program is to work. The idea is to create a simple artificial intelligence program.
1. Must be a GUI
2. Must employ at minimum one try-catch block.
3. Must include two distinct interactions with at least two questions each.
4. Must include a OK, Exit (and optional a Continue button)
Example of Interaction #1:
Your Program Asks the User:
Q#1: "Do you like red wine?" User answers Y or N (if anything other is entered like "A" or -99 your program needs to catch it and reply with the appropriate error message to the user and allow the interaction to continue).
Q#2 is based on first answer being Y. If it was N you would need to ask a different question.
Q#2: "My favorite red wine is Shiraz. Is it yours?" User answers Y or N
You need at least two questions per interaction (if you want to make your code more intelligent you can). Your program at this point should ask the user if they wish to continue with a new interaction or simply have a continue button.
Example of Interaction #2 (with more than two questions):
Q#1: "Do you have a favorite partial information zero sum game?" User Answers Y
Q#2: "Is it a poker game?" User Answers Y
Q#3: Is it Texas Hold'em?" User Answers Y or N
If the answer to Q#2 is N your program might respond with: "Is the game War?"© BrainMass Inc. brainmass.com October 9, 2019, 5:18 pm ad1c9bdddf
The attachment for this solution has a zip file. It will have the form file and java file. You need to compile it with javac before using the program.