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

  What is the primary purpose of video security

Presently, video security system hardware is based on new technology that takes advantages of the significant aid in microprocessor computing power.

  Which societies is more likely to focus on building relation

Which of the following societies is more likely to focus on building long-term relationships in business? In which of the following societies is a professor ore likely to be called by his/her first name?

  Provide a laymans explanation of uml

Describe one scenario in which it would be advantageous for you to use a definite loop as opposed to an indefinite loop when developing a program. Provide a rationale for your response.

  Write three example program in symbolic learning

Write three example program in Symbolic Learning by python language and show the result after execute each program.

  Discuss the social and economic impact of technology

Assuming that you are in this class because you are interested in becoming a programmer. So, what does it take to be a good programmer?

  Write a program that reads in two sparse matrices and stores

We are assuming that the matrices are too large to fit into memory as arrays, thus all calculations must be carried out with the matrices stored in their linked list format.

  Write a function that receives a string and return a double

Write a function that receives a string and return a double floating-point value. The function declaration would look like this

  Design the logic for a program that merges the two files

Design the logic for a program that merges the two files into one file containing a list of all students in the district, maintaining student ID number order.

  Find the student who has the highest total in the class

Type help randint in the command window or check the MATLAB help file to see what the command, randint does and what the syntax is.

  Write a program that prompts the users to pick

A theater seating chart is implemented as a two-dimensional array of ticket prices like presented below. Write a program that prompts the users to pick either a seat or a price.

  List and describe three ethical concerns that might be

q1. in 2006 thomas friedman authored a book entitled the world is flat. since that time many people have adopted a

  Create a sitemap for site defining its basic information

Each student will write a 5 page paper, which will take 3 websites and/or social media sites/channels and critically analyze them for. Create a sitemap for each site defining its basic information architecture.

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