I am looking for a clear explanation to my question (NOT looking for code), but if a bit of code helps to explain yourself, then please do.. thank you :)
Question:
-using Java
-Main class asks user for an integer input (fibonacci N term), then proceeds to calculate all the fibonacci numbers, in order, until it reaches that term.
-everything is stored into a single arraylists, of type integer. (Each digit is broken up and stored in its own index, so it is its own "element", so to speak.)
For example, i am aiming for it to go something like this:
"Please enter an N fibonacci term:"
10
At this point now, internally, I have stored the 2 base cases in an arraylist, that look like this:
ArrayList: [1, 1]
Now, I am trying to make my arraylist look like this, after user input:
[1, 1, 2, 3, 5, 8, 1, 3, 2, 1, 3, 4, 5, 5]
(notice how it stopped at the last term, 55, and also notice how the double digit values are broken up into separate elements.)
I have no problem breaking up the digits, its just the "calculating" that is giving me a hard time.. thanks in advance for any advice
[1, 0+1, 1+1, 1+2, 3+2, 3+5, 5+8, ...]