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 : alphabet
eg
line : states
ega b c d e
line : start state
eg a
line : accept states
egmathrmdmathrme
lines : transition fn
egab
ac
etc.
Notes:
Assume no spaces in input strings.
Alphabet must at least allow 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 DFATest.txt file is given in folio to describe the DFA in Example of the chapter slides, page It is a DFA that recognizes the regular language over that contain the substring 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
