Prompt the user to enter a regular expression

Assignment Help Computer Engineering
Reference no: EM132200861

Question :

Write a Java program that prints all strings defined by a regular expression up to a given length.

Assume the alphabet S = {0,1}.

Prompt the user to enter a regular expression and an integer n. Print all the strings, with length = n , defined by the regular expression.

Use console based I/O. [The empty string e can be printed with the Unicode "\u03B5", but Unicode may not be supported in some environments.]

A sample run of the program is shown bellow. Regular expression: 01*|(10)*

n: 5

------- Strings in the language -------

e

0

01

10

011

0111

1010

01111

Code from scratch. It prompts the user to enter a regular expression and an integer n.

Reference no: EM132200861

Questions Cloud

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.
Display a list of distinct numbers in the input : Display a list of distinct numbers in the input and the occurrence of each distinct value.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a new group called students in reserved range of gids

Create a new group called Students in the reserved range of GIDs. What command did you use to create this group? What was the GID of this group?

  Will it affect the speedup obtained from pipelining

If a new technology could shortene ALU operation by 25%, will it affect the speedup obtained from pipelining?

  Develop a nested multiplication for the product

Modify MatMatDot so that it efficiently handles the case when A is lower triangular and B are upper triangular and both are n-by-n.

  What was fingerprint generated with kleopatra certificate

What was the fingerprint generated with your Kleopatra certificate? What key type was used to create the certificate on Kleopatra? What other types of encryption key types are possible?

  What are indicators that your computer system is compromised

What are typical indicators that your computer system is compromised? A virus or malware can impact which of the three tenets of information systems security (confidentiality, integrity, or availability)? In what way?

  Suppose that you are the database developer for a local

suppose that you are the database developer for a local college. the chief information officer has asked you to

  Questionconsider an adt called square matrix the matrix can

questionconsider an adt called square matrix. the matrix can be represented by a 2-dimensional array of integers with n

  Show your structure before and after the deletion

A B+ tree in which the deletion of the value 42 leads to a redistribution. Show your structure before and after the deletion.

  Soda vending machine designnbspdesign a soda vending

soda vending machine designnbspdesign a soda vending machine that can deliver three kinds of soda a b and c. all the

  Implenting a code

Write down a fragment of code which reads a line of text (using getline) from standard input containing of a last name followed by the first name

  Give algorithm for converting an infix arithmetic expression

Give an efficient algorithm for converting an infix arithmetic expression to its equivalent postfix notation.

  Discuss about the crypto-currency exchanges

The topic for this research paper is breaches into crypto-currency exchanges. Your discussion must include defining what crypto-currency is.

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