and F = Fn-1 + Fn-2 for n> 1 In other words, each number is the sum of the two previous numbers in first several Fibonacci numbers are 1, 1, 2, 3, 5, and 8. Interestingly, cer rates are characterized by the Fibonacci numbers. If a population has no gives the size of the population after each time period.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
The nth Fibonacci number F, is defined as follows:
Fo = 1, F1 = 1,
and
F = Fn-1 + Fn-2 for n> 1
In other words, each number is the sum of the two previous numbers in the sequence. Thus, the
first several Fibonacci numbers are 1, 1, 2, 3, 5, and 8. Interestingly, certain population growth
rates are characterized by the Fibonacci numbers. If a population has no deaths, then the series
gives the size of the population after each time period.
Assume that a population of green crud grows at a rate described by the Fibonacci numbers and
has a time period of 5 days. Hence, if a green crud population starts out as 10 pounds of crud,
then after 5 days, there is still 10 pounds of crud; in 10 days, there is 20 pounds of crud; in 15
days, 30 pounds of crud; in 20 days, 50 pounds of crud, and so on.
Write a program that takes both the initial size of a green crud population (in pounds) and some
number of days as input from the keyboard, and computes from that information the size of the
population (in pounds) after the specified number of days. Assume that the population size is the
same for four days and then increases every fifth day. The program must allow the user to repeat
this calculation as long as desired. Please note that zero is a valid number of days for the crud to
grow in which case it would remain at its initial value.
Your output should look something like:
CWindowslaystemiemdee
ease enter the initial size of the green crud: no
m sorry that, value is unrecognized or is negat ive
lease enter the initial size of the green crud: -3
m sorry that value is unrecognized or is negative
Please ențter the initial
Please enter the number of gyà 6ounds of crud growing for 20 days.
Hith an initial population of
the final
Hould you like to cont i
am sorry
şize of the green crud: 10
populat ion would be
pounds
tinue? (y/n)why?
that
answer is not
enter
initial
enter the number of days: 0
the
şize
of
green crud: 10
Hith an initial population of 10 pounds of crud growing for 0 days.
the final population would be 10 pounds
Nould you ike to continue? (y/n)n
Press any key to cont inue . ..
Transcribed Image Text:The nth Fibonacci number F, is defined as follows: Fo = 1, F1 = 1, and F = Fn-1 + Fn-2 for n> 1 In other words, each number is the sum of the two previous numbers in the sequence. Thus, the first several Fibonacci numbers are 1, 1, 2, 3, 5, and 8. Interestingly, certain population growth rates are characterized by the Fibonacci numbers. If a population has no deaths, then the series gives the size of the population after each time period. Assume that a population of green crud grows at a rate described by the Fibonacci numbers and has a time period of 5 days. Hence, if a green crud population starts out as 10 pounds of crud, then after 5 days, there is still 10 pounds of crud; in 10 days, there is 20 pounds of crud; in 15 days, 30 pounds of crud; in 20 days, 50 pounds of crud, and so on. Write a program that takes both the initial size of a green crud population (in pounds) and some number of days as input from the keyboard, and computes from that information the size of the population (in pounds) after the specified number of days. Assume that the population size is the same for four days and then increases every fifth day. The program must allow the user to repeat this calculation as long as desired. Please note that zero is a valid number of days for the crud to grow in which case it would remain at its initial value. Your output should look something like: CWindowslaystemiemdee ease enter the initial size of the green crud: no m sorry that, value is unrecognized or is negat ive lease enter the initial size of the green crud: -3 m sorry that value is unrecognized or is negative Please ențter the initial Please enter the number of gyà 6ounds of crud growing for 20 days. Hith an initial population of the final Hould you like to cont i am sorry şize of the green crud: 10 populat ion would be pounds tinue? (y/n)why? that answer is not enter initial enter the number of days: 0 the şize of green crud: 10 Hith an initial population of 10 pounds of crud growing for 0 days. the final population would be 10 pounds Nould you ike to continue? (y/n)n Press any key to cont inue . ..
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY