Correct results 70% Well formatted report 30% Lab Task [70] This program is a simple demo of DFA. A DFA with following c
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Correct results 70% Well formatted report 30% Lab Task [70] This program is a simple demo of DFA. A DFA with following c
Correct results 70% Well formatted report 30% Lab Task [70] This program is a simple demo of DFA. A DFA with following characteristics: No of states is 4: 90, 91, 92, 93, and 44 No of symbols is 2: 'a' and 'b' Start state is qo The DFA accepts any string that ends with either aa or bb Input string is read from a file. File name is provided by user as command line argument. Input string MUST have a $ symbol as sentinel value in the end. Hint: You need to draw the DFA and its corresponding state table. From state table you can implement your logic by using goto statements. If an invalid input symbol is received the program should terminate with an appropriate message. Sample Run $ gcc lab6.c-o lab6 $ ./lab6 infile Input string is: abb$ State transitions are shown below: Received a on state qo Received bon state ql Moving to state q1 Moving to state q3 Moving to state 94 Received bon state 03 End of string. String accepted