Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I would like assistance with completing these methods. All of them must be completed recursively. 10 import static org.junit.Assert.*; 2 import org.junit.Test; 3 4 public
I would like assistance with completing these methods. All of them must be completed recursively.
10 import static org.junit.Assert.*; 2 import org.junit.Test; 3 4 public class PublicTests { 50 @Test public void testFibl() { assertEquals(1, Recursions.fib(0)); assertEquals(1, Recursions.fib(1)); 6 7 8 9 } 10 110 @Test 12 13 14 15 16 17 18 } 19 200 @Test public void testFib2() { assertEquals(2, Recursions.fib(2)); assertEquals(3, Recursions.fib(3)); assertEquals(5, Recursions.fib(4)); assertEquals(8, Recursions.fib(5)); assertEquals(13, Recursions.fib(6)); public void testNumEvens1() { assertEquals(2, Recursions.numEvens (new int[] {1, 2, 3, 4})); 1222222222 23 } 24 250 26 27 28 }| 29 @Test public void testNumEvens2() assertEquals(0, Recursions.numEvens (new int[0]));
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here are the completed recursive methods for the given test cases java public class Recursions p...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started