11.10 LAB: Fibonacci sequence (recursion) The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() method, which takes in an index, n, and returns the nth value in the sequence. Any negative index values should return -1. Ex: If the input is: 7 the output is: fibonacci (7) is 13 Note: Use recursion and DO NOT use any loops. 383590.2622292.qx3zqy7
LAB ACTIVITY 1 import java.util.Scanner; 2 3 public class LabProgram { 4 5 6 7 8 9 10 11 11.10.1: LAB: Fibonacci sequence (recursion) 12 13 14 15 16} 17 public static int fibonacci(int n) { /* Type your code here. */ } LabProgram.java public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int startNum; } startNum scnr.nextInt(); System.out.println("fibonacci(" + startNum + ") is " fibonacci (startNum)); 0/10 Load default template...