Title: Fibonacci Problem
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER

Fibonacci Problem

Create a package named fibonacci and write a program to compute and print out the results of the Fibonacci function.

The Fibonacci function generates a sequence of numbers that consists of 0,1,1,2,3,5,8,13,....

The Fibonacci function is defined as:

Fib(0) = 0
Fib(1) = 1
Fib(N) = Fib(N-1) + Fib(N-2)

Sample output should look like:

Enter in N:  6
Fibonacci(6)=8
Do you want to continue?: (y/n)  y

Enter in N:  2
Fibonacci(2)=1
Do you want to continue?: (y/n)  y

Enter in N:  5
Fibonacci(5)=5
Do you want to continue?: (y/n)  y

Enter in N:  3
Fibonacci(3)=2
Do you want to continue?: (y/n)  y

Enter in N:  4
Fibonacci(4)=3
Do you want to continue?: (y/n)  y

Enter in N:  7
Fibonacci(7)=13
Do you want to continue?: (y/n)  n

Have a good day

Run your program with the inputs shown above and insert the results in the appropriate section of the JH Worksheet

February 19, 2015 11:02 AM