Class Fibonacci

java.lang.Object
  
public class Fibonacci
extends java.lang.Object

A class whose methods implement a recursive solution to the Fibonacci Series.

Version:
SCCC West - Copyright (c) 2012
Author:
Carl B. Struck

Constructor Summary
Fibonacci()
           
 
Method Summary
static int fibonacci(int n)
          A recursive method which calculates and returns a value in the Fibonacci series for a positive integer or zero (0).
static void start()
          Gets an integer from the console, passes it to method fibonacci() and displays the resulting Fibonacci series value to the terminal window.
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fibonacci

public Fibonacci()
Method Detail

fibonacci

public static int fibonacci(int n)
                     throws java.lang.Exception
A recursive method which calculates and returns a value in the Fibonacci series for a positive integer or zero (0).

Parameters:
n - an int whose Fibonacci Series value is to be calculated
Returns:
the Fibonacci Series value of the input integer
Throws:
java.lang.Exception - thrown if the exponent parameter is a negative number

start

public static void start()
Gets an integer from the console, passes it to method fibonacci() and displays the resulting Fibonacci series value to the terminal window.

Throws:
java.util.InputMismatchException - if user enters non-integer input
java.lang.Exception - if input int is negative or greater than 40