Hi all, I'm having problem with this assignment. I just started C++ and I just can't get this assignment...if anyone could help me out and give me a code...it would be greatly appreciated. The assignment is due tomorrow...and I'm desperate...please help!
The fibonacci numbers are defined in the following way: The first fibonacci number is 1 and the second fibonacci number is 1. Thereafter, each fibonacci number is the sum of the previous two. For example, if you want to calculate the 5th fibonacci number then generate the sequence 1, 1, 2 (the sum of 1 and 1), 3 (the sum of 1 and 2), and 5 (the sum of 2 and 3). So 5 is the 5th fibonacci number.
Suppose we have an initial population of an invented organism called "green crud". "Green crud" reproduces asexually every five days. Suppose we call one generation equivalent to five days. Initially, it enters the world as a single immature organism incapable of reproducing. After one generation it matures, after the next generation it divides into two "green crud" organisms, one mature and one immature. Again the immature organism needs a generation to mature but the mature organism is ready to divide in the same way.
Problem: Write a C++ program that takes as input an initial population of immature "green crud" and determines the total population of “green crud” after:
1. One month (30 days)
2. Six months (180 days)
3. One year (360 days)
Assume no deaths along the way and assume that once an organism divides its “parent” is no longer around.
Hint: Build a model for a month using paper and pencil. Write down the sequence of the number of organisms after each generation. Notice a pattern in the number of organisms. How is the number of organism in generation i related to the number of organisms in generation i-1 and generation i-2?