Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

00 H20 9:05 PM Prog 2. DFA Evaluatorpdf 1 of 2 CS 480 Prog 2: DFA Evaluator In class, we developed an file format for

image text in transcribed
image text in transcribed
00 H20 9:05 PM Prog 2. DFA Evaluatorpdf 1 of 2 CS 480 Prog 2: DFA Evaluator In class, we developed an file format for desoribing DFAs and strings to evaluate against them Wribe a program, prog2c or prog cpp, to read a DFA's details from a file and determine whether each provided string is in is language Once compled your program should require one command line argument, the name of a DFA fie, ike his /prog2 examplett The DFA fie formated as a number of lines: Line 1: number of states (eg, 7 indicates states 1-7 along w state O,the fail state) * Line 3the number of final states folowed by the final states as a space separated list Line 5 begins the transilon table, one line for each state starting wth state 1 Each line Une 4: alphabet string (each characters member of the alphabet s a list of space separated integers to which state to transition on a character trom the alphabet Afherward, each line is a non-empty string of characters from the alphabet to valdate aganst the DFA For example, the fle on the right details the DFA from the table on the left 23T 2 5 The output of the program should be one line for each of the test strings in the DFA le Each line should begn wth Yor r ndcating the singsorsnot respectvety, the language of the DFA. After this is one space followed by the test string and a newline Open With Print

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

More Books

Students also viewed these Databases questions

Question

=+will appear. Make sure it's portable. Ask yourself:

Answered: 1 week ago