[Solved] C Pointer Structs Classes 2d Array Finite State Machine Recognizers Easy Encode Also Many Q37208359
C++
No pointer, structs, or classes. Just 2D array!
Finite state machine recognizers are easy to encode. There arealso many ways to encode them. However, for this lab, you MUSTencode a finite state machine recognizer using a table lookup(i.e., put the specifications for the machine in an array and usethe array to determine all output and transitions). The machinethat your program must emulate is the machine that recognizes thestrings represented by the regular expression
a*ba*b
The program MUST READ ONE CHARACTER AT A TIME AND CHANGE STATE,THEN READ ANOTHER CHARACTER AND CHANGE STATE, ETC.
YOU WILL LOOSE POINTS IF YOU USE A GETLINE OR STORE ALL THEOUTPUT THEN PRINT IT ALL OUT AT ONCE.
IF YOUR PROGRAM USES SOMETHING OTHER THAN A TABLE LOOKUP, YOUWILL LOSE 10 POINTS.
IF YOUR PROGRAM READS AN ENTIRE STRING AND THEN PROCESSES IT,YOU WILL LOSE 10 POINTS.
If YOUR PROGRAM WRITES ANYTHING OTHER THAN 1’S AND 0’S YOU WILLLOSE POINTS.
If you use file I/O (fstream), you will loosepoints. The data will be redirected from a file and willcontain one input string followed by a newline (n). The emptystring will be represented as simply a newline. There will be nospaces between the characters.
Expert Answer
Answer to C++ No pointer, structs, or classes. Just 2D array! Finite state machine recognizers are easy to encode. There are also … . . .
OR

