ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 13 Weeks Ago, 1 Day Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 02 May 2017 My Price 8.00

Write a method that takes a String as a parameter and prints

Which Expression:

Write a method that takes a String as a parameter and prints to the screen which of the regular expressions shown below is satisfied by the String. The String can only contain the characters a and b and you must use the.matches(<...>) method with a regular expression. The method doesn't have to return anything.

 

Regular Expression No.                 Regular Expression

1:                                                         a(b|a)b

2:                                                        (ab)* b

3:                                                        a(b|a)*

4:                                                        ( (a|b) a)*

If the String satisfies more than one regular expression print each one on a new line. See output below. If the String does not satisfy any expression have a valid print statement stating this fact. In your main method call the method with user input.

 

Test case(s)

-----

Sample Input:

abb

Sample Output:

1

2

3

-----

Sample Input:

ababad

Sample Output:

Not in the language

-----

Answers

(11)
Status NEW Posted 02 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)