FSM Assignment

Job ID: 33989023

Budget: $10 – $20 USD

For this assignment, construct a finite state machine that accepts the language "any sequence of a's and b's ending in bbab". Download the attached code, FSMTmplt.java, to your last_name package directory and rename all occurrences of FSMTmplt to FSM. Then examine the inner classes FSM1 and FSM2 for examples showing how to construct your machine in inner class FSM3, which is currently empty. FSM1 and FSM2 reflect the examples given in the lecture notes. Although a finite state machine is a 5-tuple, there are only 4 configuration variables that need to be set. The states are assumed to be 0, 1, 2, ... and are used as row indices of the delta state transition table. Your alphabet should be the two characters a and b, and so delta only needs two columns, which correspond to the order of the characters in the alpha variable. There is no need for states to handle arbitrary characters. The method exec() will check for out-of-alphabet characters. You can run the examples FSM1 and FSM2 by setting the select variable in main() to 0 or 1 respectively. To test your machine, set select to 2. main() will test your machine with strings that should be accepted and rejected. Submit FSM.java with your FSM3 coded when FSM3 correctly accepts or rejects all the test strings. The machine should have about 5 states.