Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Lab18C: Write a recursive method that will do the following: It should accept two strings. The first string will be longer than the second

JAVA

  1. Lab18C: Write a recursive method that will do the following:
  • It should accept two strings. The first string will be longer than the second string. It should return a string that is equal to the first string with all instances of the second string removed.

Example: If the method receives Mississippi and iss then it should return Mippi, which is Mississippi with all occurrences of iss removed.

If the method receives disfunctional and fun, it will return disctional.

If the second string is not inside the first string, then the method will just return the first string.

  • Your recursive method should not have a loop inside it. It should rely on the recursion to do the looping.
  • Write a program to test your method (and make sure you test it with more than one set of data. There is no telling how many times the second string may be found in the first string.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions