
/* rectester.cpp tests a recursive Fibonacci function.
 *
 * Input:  a positive integer n
 * Output: the nth element of the Fibonacci sequence
 *
 * Written by:   Larry R. Nyhoff
 * Written for:  Lab Manual for C++: An Introduction to Data Structures
 *************************************************************************/

#include <iostream>
using namespace std;

/* RecFibonacci is a recursive Fibonacci number calculator
 *
 * Receives: postive integer n
 * Returns:  the n-th Fibonacci number
 * Your name and other documentation required by
 *  your instructor go here
 ********************************************************/

// DEFINE RecFibonacci HERE


int main()
{
  int number;

  for (;;)
  {
    cout << "Please enter a positive integer: ";
    cin >> number;
    if (number > 0) break;

    cerr << "*** The number must be positive.\n\n";
  }

  cout << "The " << number << "-th Fibonacci number is "
       << RecFibonacci(number) << endl;
}

