Question: method that returns true if the given string contains a jan string, but where the middle 'a' char can be any char. janThere(abcjon) true janThere(j9n)

method that returns true if the given string contains a "jan" string, but where the middle 'a' char can be any char.

janThere("abcjon") true

janThere("j9n") true

janThere("jac") false

public boolean janThere(String str)

{

method called countSam that returns the number of times that the string "sam" appears anywhere in the given string.

countSam("abc sam hi") 1

countSam("ABCsam sam") 2

countSam("samsam") 2

public int countSam(String str)

{

change method so that it changes the message and places the word "um" in place of each space in the message.

nervousMsg("I don't know.") "I um don't um know."

public String nervousMsg(String str)

{

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!