#
/**

* Fibonacci class * * The Fibonacci Sequence is the series of numbers: * * 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... * * The next number is found by adding up the two numbers before it. * - The 2 is found by adding the two numbers before it (1+1) * - Similarly, the 3 is found by adding the two numbers before it (1+2), * - And the 5 is (2+3), * - and so on! * * Example: the next number in the sequence above would be 21+34 = 55 * */public class Fibonacci { /** * Gets the nth fibonacci number using ITERATION * @param num * - n >= 0 * @return int * - the nth fibonacci number * * Example: * input: | Output: * num = 2 | 1 * num = 3 | 2 * num = 7 | 7 * */ public int getFibIter(int num) { //TODO } /** * Gets the nth fibonacci number using RECURSION * @param num * - n >= 0 * @return int * - the nth fibonacci number * * Example: * input: | Output: * num = 2 | 1 * num = 3 | 2 * num = 7 | 7 * */ public int getFibRec(int num) { //TODO } /** * Displays the fibonacci series from 0 to the given number. * @param num * - limit of the sequence of fibonacci numbers to display * * Example: * Input | Output * 3 | 0, 1, 1, 2 * 7 | 0, 1, 1, 2, 3, 5, 8, 13 */ public void printSequence(int num) { //TODO } }

Your HELP is badly needed and appreciated. Thanks!

1
by gielou

Log in to add a comment