Question: please follow up the instructions and fill up the code in number 2. the code needs to compile and pass some of the j unit




2. Lab Requirements You are not allowed to use any regular expressions, loops, or any methods such as "contains", "replace" and so on to solve the problem. In other words, the problem should purely be solved by recursion, and therefore any method that lets you get away from designing a recursive algorithm should be avoided. To practice testing, you are provided with a set of incomplete test cases. You should make sure to add enough test cases that test your code thoroughly. Please have a look at the tester code Lab2Tester and add more test cases to test your code thoroughly. 4.2. Method makeString 0 For this task, you are expected to implement a recursive function that creates and returns a string of length n using the given character. For example, if the given character is \#, and n=5, the output should be \#\#\#\#\#. Please note that a string with length zero is also possible. To concatenate to a string, the simple ' + ' operator should be used. The name of the method is makeString and the header of the method was written for you in Lab2.java. 4.3. Method writeChars0 Write a recursive method writeChars that accepts a positive integer n and that returns n characters: The middle character should always be an asterisk ("*"). If you are writing an even number of characters, there will be two asterisks in the middle ("**"). Before the asterisk(s) you should add less-than characters (""). For example, the following calls produce the following output: The name of the method is writeChars and the header of the method was written for you in Lab2, java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
