package labs; import javax.swing.JOptionPane; public class FiboIterate { /** Counts the number of times the while loop in fiboiterate runs. * You need to add code to make this count work. * * Compare the difference between this number in the recursive and iterative * approach for different values of n (fiboLoopCounter versus fiboRecurseCounter) */ private static fiboLoopCounter = 0; public static void main(String[] args) { String input = JOptionPane.showInputDialog("Enter the value for n the size of the Fibonacci sequence : "); int n = Integer.parseInt(input); /* add function call to the function fiboiterate here */ /* add function call to print the nth Fibonacci number and the total number of times the while loop looped. */ System.exit(0); } /** Computes a Fibonacci number. @param n an integer @return the nth Fibonacci number */ public static int fiboiterate(int n) { int k=1; int num1 = 1; int num2 = 0; System.out.print(" "+num2+" "+num1); while (k < n) { /* add the logic for generating the fibonacci sequence*/ /* add the line to print the sequence */ } //return the nth Fibonacci number } }