Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Finite state machine recognizers are easy to encode. There are also many ways to encode them. However, for this lab, you MUST encode a finite

Finite state machine recognizers are easy to encode. There are also many ways to encode them. However, for this lab, you MUST encode a finite state machine recognizer using a table lookup. The machine that your program must emulate is the machine that recognizes the strings represented by the regular expression a*b*ab 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 THE OUTPUT THEN PRINT IT ALL OUT AT ONCE. IF YOUR PROGRAM USES SOMETHING OTHER THAN A TABLE LOOKUP, YOU WILL 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 WILL LOSE 10 POINTS. The data will be redirected from a file and will contain one input string followed by an end of line. If you use file I/O (fstream), you will loose 10 points. The empty string will be represented as simply an end of line. There will be no spaces between the characters.

For example, if the input file contained aabbbab The output would be 00010001 If the input were ab The output would be 001 If the input were an end of line, the output would be 0 If the input were aba The output would be 0010 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

60 Workplace safety risks.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago