Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following Java programs; then build and run them. When they build and run correctly, copy the code into a separate text file for

Write the following Java programs; then build and run them. When they build and run correctly, copy the code into a separate text file for each program, with the same name as that program. Submit the text files. (*If a program has more than one class, include all classes in that programs text file.)

  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

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

LO2 Distinguish among three types of performance information.

Answered: 1 week ago