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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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