Answered step by step
Verified Expert Solution
Question
1 Approved Answer
L={w{a, b}*:w contains no more than one b}. L is accepted by the following DFSM M: We can simulate M by the following program: While
L={w{a, b}*:w contains no more than one b}. L is accepted by the following DFSM M:
We can simulate M by the following program:
While (true)
{
S: c= read char()
If( c== EOF) print yes;
else if ( c== a) go to S;
else if (c==b) go to T
T: c= read char()
If( c== EOF) print yes
else if ( c== a) go to T
else if (c==b) print no
}
This above note is just an english version of the java code. I need a java code that runs L using the above while loop. look at the picture posted for more information as to how to continue the code.
1. Write a Java program to read in a DSFM, then decides if an input string is accepted by the DSFM or not. You can assume the input DSFM is legal, and states are named with single letters. Note . The program has 2 parts: l. Read in the start tate, the final states, and the transitions of the input DSFM. (no need to read| K or since the transitions would imply those) -Use a Vector String to store the set of final states. . Use a VectorStep 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