CS 14 - Fibonacci Table

Once upon a time, a learned gentleman and mathematician in the city of Pisa asked the following question:
A certain man put a pair of rabbits in a place surrounded on all
sides by a wall. How many pairs of rabbits can be produced from that
pair in a year if it is supposed that every month each pair begets a
new pair which from the second month on becomes productive?  
By itself this is no great event, however the gentleman in question was named Leonardo Pisano, (aka Fibonacci), he was writing one of the few mathematical texts to be developed in Europe in the 13th century, and he solved the question quite nicely by examining the following facts: Application of this rule generates the sequence:
1, 1, 2, 3, 5, 8, 13, 21, 34, ...
For every element n after n=2, this is simply the sum of element n-1 and n-2. This sequence is called the Fibonacci Sequence, and can be found throughout math and science.

Tables

In Computer Science we use the Fibonacci Sequence a lot as a teaching tool for recursion. However, in this assignment, we are not going to use simple recursion, instead we are going to demonstrate a very simple case of a more powerful technique: dynamic programming. Dynamic programming is like recursion in that you break a problem down into easier problems, but instead of simply calling a function to calculate the result of a previous problem, we first check if we have ever calculated that result before by looking in a table of old results.

A table for the Fibonacci Sequence is simply an array. To begin with, the first two elements of the array are filled in with value 1. To find any other value n, we simply check the table at that location: if it is not filled in, we perform the recursion as normal. If it is, we return that value.

Specs

Write a program that allows the user to enter a value n (in the range [1-45]) and have the nth digit of the Fibonacci sequence (counting from 1) printed out. When the user enters a value of -1, terminate the program. When the user enters anything outside of the range [1-45], do not print anything.

To begin with, your program should print this message:
Fibonacci Sequence Calculator
Enter a -1 to quit, or an int n in the range [1-45] to
see the nth value of the Fibonacci sequence
To earn full credit on this, you should implement a table storing the values of the Fibonacci sequence, but do NOT just fill in all the values of the table from 1-45, your table may only be as large as the largest index requested so far (that is, if the largest index the user has entered is 10, then the table should be no larger than 10 ints). To do this, you will need to use:

Hints