/**
 * FibDriver = Fibonacci sequence driver.  
 * This class takes input from an argument and calls Fib.java
 * to run a recursive fibonacci number on it if given an argument. 
 * If not, then it runs the call to fibonnaci for the number 5.  
 * Also checks if n > 35 then caps at 35. 
 *
 * @author Alvin Chao
 * @version 11-1-16
 * Acknowledgements: I received no help on this Example.  
 * Or I received help from Prof. Chao on the 'method name' 
 * method or on test cases, etc...
 */
public class FibDriver {

/**
 * Main method.
 * @param args - argument int input to get the fibonacci sequence for.
 */
    public static void main(String[] args) {
        final int DEFAULT_NUMBER = 5;
        int n = DEFAULT_NUMBER;
        final int MAX_FIB = 35;
        
        if (args.length > 0) {
            n = Integer.parseInt(args[0]);
        }
        if (n > MAX_FIB) {
            n = MAX_FIB;
            System.out.println("Your number is too large. Capping at 40");
        }
        System.out.println("Index: Fibonacci sequence.");
        System.out.println("---------------------------");
        for (int i = 1; i <= n; i++) {
            System.out.println(i + ":\t\t " + Fib.fibonacci(i));
        }
    }
}
