
Solve in Java please
1 Fibonacci Sequence The Fibonacci sequence is named after the Italian mathematician Leonardo of Pisa, also known as Fibonacci. The steps for the for the Fibonacci sequence are to start with the 0th and 1st terms, which are 0 and 1 respectively, and to calculate the next term, sum the previous two terms. Using the initial numbers 0+1=1 the 2nd term in the Fibonacci sequence is 1 . Now that you know the pattern, here are the 0th through 8th numbers in the Fibonacci sequence: 0,1,1,2,3,5,8,13,21. Now let's write a Fib class to help us find the nth Fibonacci number. Write the following functions in the Fib class: - public static int fibonacciRecursive(int n ) - this will return the nth Fibonacci number as an int using a recursive approach. - public static int fibonacciIterative(int n ) - this will return the nth Fibonacci number as an int using an iterative approach. Here are some test cases: Example Test Cases: - fibonacciRecursive(3) will return 2 - fibonacciRecursive(5) will return 5 - fibonacciIterative(8) will return 21 - fibonacciIterative(10) will return 55 Once you have your methods working, use the Scanner class to prompt for input in the main function of Fib. Hint: For a reminder on how to use Scanner class, the Scan.java file on Canvas is a good place to start. This example explains how to take ints as input. For example, to take in an integer for the Fibonacci functions, your Java code could be the following (in main): public static void main(String args[]) \{ System.out.println("Enter an integer n to get the n'th Fibonacci number:"); Scanner myScanner = new Scanner (System.in); int n= myScanner.nextInt ();// gets an integer from command line System.out.println("The +n+ "' th Fibonacci number using fibonacciRecursive is " + fibonacciRecursive (n)); System.out.println("The " +n+ "'th Fibonacci number using fibonacciIterative is " + fibonacciIterative (n));