2. Your program next asks the user if they want to enter a string. The user thenenters “y” for “yes”, or “u” for ‘no’« If the user enters “n”, then the program terminates.« If the user enters...

1 answer below »
please use python


2. Your program next asks the user if they want to enter a string. The user then enters “y” for “yes”, or “u” for ‘no’ « If the user enters “n”, then the program terminates. « If the user enters “y”, then the user is prompted to enter a string over I. 3. If the user chooses to input a string, your program then reads in the string. After reading in the string, your program prints it. Then your program processes the entire string on the DFA, one character at a time, in the following manner « Your program must begin in the start state of the DFA and print out the name of that state (g; or go) © After each character from the string is processed on the DFA, your program must print out the character and the name of the current state of the DFA. Even if your DFA is in a trap state, your program must do this for each character in the string until it reaches the end of the string, To simplify your program, you can check the ASCII code of each character of the string and process on the DFA accordingly 1. After processing the entire string on the DFA, your program must indicate if the string is accepted or rejected based on the state in which the DFA ended. Your program then should return to step 2. 5 Test Cases Test your program on each of the following input strings: 1. £80900ab32cdef con 2. 20¢.com 3. bagba.co 1. edfge.con wab2veb. a. co7c. cond]. k68c42. computer. con 3 6. foBodgoa2. con. .con 7. ab67qe. Gbaom. con 8. edu2cacomputorss. comp 9. redbluedgreen. .con 10. randonsocon 11. p654aa7eass. con. con 12. waudcon. coma 13. waubacon. co 14. 34big. condbbder29. con 15. foodofor. cond 16. net.a.b.4cOconna3. con. con 17. netB4vork. abbacommon. 6con. con 1. Gabede. con 19. peoples. d7og. cBattc. cons. con 20. cable. .cordefort. con ‘You must create an output file containing your program’s output from each test case in the order abave
Answered 1 days AfterOct 09, 2022

Answer To: 2. Your program next asks the user if they want to enter a string. The user thenenters “y” for...

Rakesh answered on Oct 09 2022
62 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here