Your task for this lab is to write a program in any language you like(c language) to determine the number of rabbits we would have in 24 months.  You can check the validity and correctness of your program by testing the count at month 3, 4, and 5 to see if it matches the pair count in the diagram

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Your task for this lab is to write a program in any language you like(c language) to determine the number of rabbits we would have in 24 months.  You can check the validity and correctness of your program by testing the count at month 3, 4, and 5 to see if it matches the pair count in the diagram.

First, review the following diagram:
December
Young black couple
January
Black couple now adult
February
Red twins for Black couple
March
Blue twins for Black couple
April
Twins for Black, twins for Red
May
Twins for Black,
Red, Blue couples
it to
#bath
**********
Image source: Problematics: The breeding habits of Facebook shares and Fibonacci
rabbits.
This diagram represents the Fibonacci sequence in nature. You will recall that the
Fibonacci sequence is achieved by continually adding sums of numbers starting with
1+1.
1+1=2; 2+1=3; 3+2=5; 5+3=8; 8+5=13; and so on.
What does this have to do with our course in Sim and Mod? Well, suppose we want
to determine how many rabbits we would have if we kept one pair for two years (or
24 months). We could get two rabbits, feed and care for them for two years, then
count the rabbits. Too time-consuming and expensive, and we may not have the
facilities to do it. So we can use a mathematical model (the Fibonacci sequence)
and run a computer simulation.
Your task for this lab is to write a program in any language you like to determine
the number of rabbits we would have in 24 months. You can check the validity and
correctness of your program by testing the count at month 3, 4, and 5 to see if it
matches the pair count in the diagram.
Transcribed Image Text:First, review the following diagram: December Young black couple January Black couple now adult February Red twins for Black couple March Blue twins for Black couple April Twins for Black, twins for Red May Twins for Black, Red, Blue couples it to #bath ********** Image source: Problematics: The breeding habits of Facebook shares and Fibonacci rabbits. This diagram represents the Fibonacci sequence in nature. You will recall that the Fibonacci sequence is achieved by continually adding sums of numbers starting with 1+1. 1+1=2; 2+1=3; 3+2=5; 5+3=8; 8+5=13; and so on. What does this have to do with our course in Sim and Mod? Well, suppose we want to determine how many rabbits we would have if we kept one pair for two years (or 24 months). We could get two rabbits, feed and care for them for two years, then count the rabbits. Too time-consuming and expensive, and we may not have the facilities to do it. So we can use a mathematical model (the Fibonacci sequence) and run a computer simulation. Your task for this lab is to write a program in any language you like to determine the number of rabbits we would have in 24 months. You can check the validity and correctness of your program by testing the count at month 3, 4, and 5 to see if it matches the pair count in the diagram.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

what would this look like written in java?

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Bare Bones Programming Language
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education