Write a java program that takes as input a dfa m

Assignment Help Computer Engineering
Reference no: EM132200862

Write a Java program that takes as input a DFA M and an input string w, simulates M on w, and outputs ACCEPT if M accepts w, and REJECT if M does not accept w.

You will assume that the alphabet is ? = {0,1} and that the DFA has at most 20 states. The states are labeled 1,2, ...20. Suppose that the starting state is 1. In order to input the DFA you will do the following:

• You will ask the user to enter the transition function d (either you can prompt the user by asking questions of the type "enter the state M goes to from state 14 and symbol 1", or the user will just enter a list of 3-tuples, where a 3-tuple has the form (old-state, symbol, new state).

• Next, you will ask the user to enter the set F of accepting states. Next you will ask the user to enter the input string w.

Test your program with the DFA from Example 1.11, page 38 ( run that DFA on 3 strings that are accepted and 3 strings that are not accepted), and the DFA from Example 1.68 (a), page 76 ( run that DFA on 3 strings that are accepted and 3 strings that are not accepted). Turn in:

• The code of your program (should be well documented)

• o A short description of your program (1 page should be enough), including a presentation of the data structures that you have used to represent the DFA and the input string w (probably some types of arrays or linked lists).

• o 2- 3 printouts with the screens when you run the program.

Reference no: EM132200862

Questions Cloud

Write a java program that prompts for and reads a course : Write a java program that prompts for and reads a course name, its credits and reference book.
Automatically pushing out windows 10 os upgrade : Do recall when Windows update was automatically pushing out Windows 10 OS upgrade? What was your reaction to this event?
Find opportunity costs of every product for each country : Calculate the opportunity costs of every product for each country and show your calcualtions. Which country has an absolute advantage in the production.
Write a java program that uses 1-d array to implement finite : Write a Java program that uses one-dimensional arrays to implement finite sets and set operations union, difference, and intersection.
Write a java program that takes as input a dfa m : Write a Java program that takes as input a DFA M and an input string w, simulates M on w, and outputs ACCEPT if M accepts w, and REJECT if M does not accept w.
Prompt the user to enter a regular expression : Write a Java program that prints all strings defined by a regular expression up to a given length.
Write a program that reads ten characters into a linked list : Write a java program that reads ten characters into a linked list and displays them in the reverse of the order in which they were read.
Write a java program with two checkboxes : Write a Java program with two checkboxes, one labeled BLUE and the other labeled ORANGE.
Reverse the order of words and displays on the console : Write a Java program that reads a file, reverses the order of words and displays on the console. The words can be on the same or separate lines.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a program to play connect four

Write a program to play Connect Four. Connect Four is a two-player connection game in which the players first choose a color and then take turns dropping colored discs from the top into a seven-column.

  What is the difference between a set and a map

What is the difference between a set and a map? Why is the collection of keys of a map a set and not a list? Why is collection of the values of a map not a set?

  Discuss collisions and collision strategies

Discuss collisions and collision strategies, including linear probing, quadratic probing, and chaining. All in python data structure.

  Explain the differences between data voice and video

explain the differences between data voice and video signals in 200 to 300 words. include a description comparing the

  How can bob find out the type of the packet if tag value is

Bob receives a PGP message. How can he find out the type of the packet if the tag value is? Can a packet with a tag value of I contain another packet?

  What would you do to ensure your email privacy and security

Do you think email is a secure way to share sensitive information? What would you do to ensure your email privacy and security?

  Determine the number of times interest charges were earned

Katula Company reported the following on the company's income statement. Determine the number of times interest charges were earned for 2016 and 2015.

  How many system calls can the computer execute

How many system calls can the computer execute per second and still have half the CPU capacity for running application code?

  Write a program that counts how often each word occurs

Write a program that counts how often each word occurs in the supplied text file mary.txt.

  Write the sql statements to satisfy the requests

Write the SQL statements to satisfy the requests. Test the statements and show execution results.

  Design a class named preferred customer

Design a class named Preferred Customer, which is derived from the Customer class you created in Programming Exercise 4.

  Explain strategic role the system will play in the company

Explain strategic role the system will play in the company. An executive summary of the project, succinctly summarizing the rest of the material in the paper.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd