# Pls help me idnk what to do :((

• 08-01-2011, 03:17 PM
kissmeeq
Pls help me idnk what to do :((
Problem 2: (Fibonacci.java)
Given two numbers f1 and f2, the Fibonacci series defined on f1 and f2 is a sequence of terms s1, s2, s3, s4, s5, … and so on such that s1 = f1, s2 = f2, and sn = sn1 + sn2 for all n > 2 (i.e., the 1st term is equal to f1, the 2nd term is equal to f2, and from the third term onwards, the value of a term is equal to the sum of the two immediately preceding terms; e.g., the value of the 3rd term will be the sum of the 1st and 2nd terms, the value of the 4th term will be the sum of the 2nd and the 3rd terms, the value of the 5th term will be the sum of the 3rd and the 4th terms, and so on).
For example, assuming that f1 = 0 and f2 = 1, the first 10 terms of the Fibonacci series will then be:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34
Write a program that accepts as input values for f1 and f2, as well as a positive integer n. The program then prints out the first n terms of the Fibonacci series defined on f1 and f2, as well as the sum and the average of the said terms.
• 08-01-2011, 03:25 PM
Norm
Quote:

idnk what to do
I think you are supposed to write a java program.
• 08-01-2011, 03:26 PM
JosAH
Please don't dump all your homework here; at least show some effort so you can make us believe that you at least tried. And please try to write proper English; English is not my native language.

kind regards,

Jos
• 08-01-2011, 03:36 PM
kissmeeq
uhm sir sory uhm i have written my program in my first thread and i think its the same but i cant figure it out something like that im sorry but please can u help me?
• 08-01-2011, 03:38 PM
Norm
Post the code you have written for this assignment and add your questions about the problems you are having.
Be sure to put the code in code tags. Use the #icon above the input box.
• 08-01-2011, 03:40 PM
JosAH
Quote:

Originally Posted by kissmeeq
uhm sir sory uhm i have written my program in my first thread

No you haven't; you have written an (incorrect) attempt to approximate pi but that hasn't much to do with Fibonacci numbers (well, actually it has but that is beyond the scope of your question).

kind regards,

Jos
• 08-02-2011, 12:53 AM
Junky
Quote:

Pls help me idnk what to do
I suggest learning to spell.