Consider the following program:
public class Exercisel4 {
public static int f(int n) {
// Precondition: n ⇐ 0.
System.out.printf(“Enter f: n = %d\n”, n);
switch (n) {
case 1: case 2: case 3:
return n + 1;
default:
return f(n-l) * f(n-3);
} // end switch
} // end f
public static void main(String[] args) {
System.out.println(“f(8) is equal to ” + f(8));
} // end main
} // end Exercisel4
Show the exact output of the program. What argument values, if any, could you pass to the method f to cause the program to run forever?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.