I don't wanna look like [I'm lazy] and just asking to do a program for me, but I have been trying to figure it out for a total of 4 hours. The exact requirements are:
Just throw suggestions out there. By the way, I use vb 6.0Code:2) Write a program that will calculate the Fibonaci sequence up to a given element. Write a program that will allow the user to enter the 10, and the 34 will be calculated. Remember the Fibonaci sequence is generated by giving yourself the first two values, 0 and 1, and then adding the two previous values to get the next value. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, For example: Fibo(3) = Fibo(1) + Fibo(2) = 0 + 1 = 1 Fibo(4) = Fibo(2) + Fibo(1) = 1 + 1 = 2 Fibo(5) = Fibo(3) + Fibo(4) = 1 + 2 = 3 Etc. Hint: You will need to preserve the TWO previous values in variables, not just the ONE previous value like we have done with all the rest of the loops.




Reply With Quote