Question: Please follow the instructions and do the code in Java. The Purpose is to model a DFA ( Deterministic Finite Automaton ) and use it

Please follow the instructions and do the code in Java. The Purpose is to model a DFA (Deterministic Finite Automaton) and use it to accept strings of the associated language.
Input: The program should take the DFA description from a text file that is specified as a command line parameter. If the command line parameter is missing, the program should hint the user to execute the program with a command line parameter for the file name and then terminate the program. Strings to be tested for inclusion in the language should be repeatedly entered interactively by the user during the execution time until the user indicates no more input.
Output: For each string being tested, the program should indicate whether or not the string is accepted.
DFA input format:
line 1: alphabet -
eg.\(\{0,1\}\)
line 2: states -
eg.\(\{a, b, c, d, e\}\)
line 3: start state -
eg. a
line 4: accept states -
eg.\(\{\mathrm{d},\mathrm{e}\}\)
lines 5-: transition fn -
eg.\((a,0)->b \)
\((a,1)->c \)
etc.
Notes:
- Assume no spaces in input strings.
- Alphabet must at least allow \(\{0,1\}\). Please feel free to expand this.
- States must at least allow letters, but you are welcome to expand this.
- Transition functions may appear in any order in the input text file. End of the input file indicates the end of transition functions.
- You must team up with at least one and at most two other students in class. Full participation of each member in a team is expected.
- The sample DFA-Test.txt file is given in folio to describe the DFA in Example 2 of the chapter5 slides, page 13. It is a DFA that recognizes the regular language over \(\{0,1\}\) that contain the substring 001. You can use this as your first sample test file. But you are required to submit a different DFA and make sure that your own DFA input file fits the format in the project description.
gives an overall project description;
shows your own DFA sample file (different from the given DFA input
sample), the state diagram of your DFA, and the regular expression that
defines the regular language your DFA is supposed to accept;
includes screenshots of the execution results to show least one string to be
accepted and at least one string to be rejected.
You must have screenshots that demonstrate your program execution
that is based on your own DFA text file, not the sample.
Please follow the instructions and do the code in

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 Programming Questions!