Quote:Original post by empirical2Quote:Original post by Blckknight118
Ok I got the program to add every 5 times using this code:
while(crud_days % 5 != 0 && crud_days % 5 != 1)
When I asked you how many growths there would be in 30 days, is that how you worked it out in your head?
How did you get 6 from 30?Quote:I really don't understand Fibonacci's numbers though I used this formula and it didn't work.
Your original code was closer.
I suggest you wiki Fibonacci's numbers, you cannot tell the computer how to do it, until you understand them yourself.
For the growth, I simply divided by 5.... For every 5 days, you do Fibonacci's code. So if the user enters in 15 days, Fibonacci's code is done 3 times because the amount of growth grows at a rate of every 5 days using Fibonacci's code.
My original code was closer....Ok thanks