Question: language: Java Input: 12 10 4 30 28 18 7 13 17 10 9 35 10 20 Thank you! Problem 3. (File I/0) The Fibonacci

 language: Java Input: 12 10 4 30 28 18 7 13

language: Java

Input:

12 10

4 30

28 18

7 13

17 10

9 35

10 20

Thank you!

Problem 3. (File I/0) The Fibonacci numbers Fn are defined as follows: Fo is 0, F? is 1, and Fi-2- Fi+ Fi-1 fori-0,1,2,.. In other words, each number is the sum of the previous two numbers. The first few Fibonacci numbers are 0, 1,1, 2, 3, 5, and 8 One place where these numbers occur is as certain population growth rates. If a population has no deaths, then the series shows the size of the population after each time period. It takes an organism two time periods to mature to reproducing age, and then the organism reproduces once every time period. The formula applies most straightforwardly to asexual reproduction at a rate of one offspring per time period. In any event, the green crud population grows at this rate and has a time period of five days. Hence, if a green crud population starts out as 10 pounds of crud, then in 5 days, there is still 10 pounds of crud; in 10 days, there is 20 pounds of crud; in 15 days, 30 pounds; in 20 days, 50 pounds; and so forth. Write a program that takes both the initial size of a green crud population (in pounds) and a number of days as input from a file greencrud.txt (organized as initial size 'space' number of days), and outputs the number ofpounds of each green crud population after that many days to an output file called crudout.txt (make sure each output is labeled somehow). Assume that the population size is the same for four days and then increases every fifth day. Input file: greencrud.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!