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

  Developing the flowchart using visual logic

Develop a flowchart by using the Visual Logic for a program which accepts a candy name.

  How to administer the paging to minimize m is an important

The basic model for this is that there are two levels, a large but slow-access main memory, and a small but fast-access memory called the cache.

  Calculate the cost of adding peripherals to computer system

Reasonable Computers Corporation would like an applet to calculate the cost of adding peripherals to a basic computer system.

  Determine the sum of all elements in vector

Replace each negative number in matrix M1 with zero. The matrix M1 is already defined.

  Define the human elements in it strategy

The success factors for your organization's information technology (IT) were identified in the previous assignment. Now, you can turn your attention.

  Benefits and de-merits of using mobile computing technology

Analyze the benefits and de-merits of utilizing the mobile computing technology to monitor the patients. Assess the security concerns with regard to transmission of the personal medical information over the wireless networks.

  Difference between mandatory and benchmark practices

What is the difference between mandatory and benchmark practices? The response must be typed, single spaced.

  How to prepare some of its high-quality publications itself

how to prepare some of its high-quality publications itself

  Create a list of strings do not ask from the user

Create a list of strings, don't ask from the user, and return a list with the strings in sorted order, except group all the strings that begin with 'x' first.

  Write a script that prompts for a string

Write a script that prompts for a string and then checks whether it has at least 10 characters using (i) case, (ii) expr.

  Calculate the average delay in the queue

Discuss about the Question related to the Simulation and modelling.Answer the given Questions from the given data.The data below shows the arrival time , service time , and delays for 6 customers arriving at a Barbershop, which has one Barber, and ..

  How does a servlet get a cookie that is coming from a client

How does a servlet get a cookie that is coming from a client? Describe the two kinds of people who develop and maintain dynamic documents.

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