Question: 1 You are given the following problem: Given a string str, you are to transform it and return a string based on str where all

1 You are given the following problem: Given a string str, you are to transform it and return a string based on str where all characters r have been removed. Your method, called removeRs, should be recursive. Write the java code of this method as an answer to this question.

Reminder: recursive functions need to satisfy the following two properties: A recursive function includes base case(s) in its body. A recursive function calls itself within its body. o But careful: it should call itself on a version of the input that is closer to the base case.

2 You are given the following problem: Given a string str, you are to transform it and return a string based on str where the following characters have been removed: Character at index 0 Character at index 1 Character at index 3 Character at index 6 Character at index 10 Character at index 15 Etc.

2.1 First, figure out the pattern of this problem and describe it in one sentence or two. Note: Make sure that your writing is legible and that grammar and spelling do not come in the way of understanding what you wrote.

2.2 Then you are asked to write an iterative java method, called removeMysteryI, to solve this problem. Note: iterative methods use loops only, no recursion.

2.3 Finally, you are asked to write a recursive method, called removeMysteryR, to solve this problem

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 Databases Questions!