Question: Example 2: Input: Enter the number of years: 10 Output: Prey population =330.08 Predator population =20.58 Problem 3: In a predator-prey simulation, you compute the

 Example 2: Input: Enter the number of years: 10 Output: Preypopulation =330.08 Predator population =20.58 Problem 3: In a predator-prey simulation, you

Example 2: Input: Enter the number of years: 10 Output: Prey population =330.08 Predator population =20.58 Problem 3: In a predator-prey simulation, you compute the populations of predators and prey, using the following equations: preyn+1=preyn(1+ABpredn)predn+1=predn(1C+Dpreyn) Here, A is the rate at which prey birth exceeds natural death, B is the rate of predation, C is the rate at which predator deaths exceed births without food, and D represents predator increase in the presence of food. Write a program that asks the user for the number of years. Then print the populations of prey and predator for the given number of years. The values of A is 0.1,B is 0.01,C is 0.01, and D is 0.00002, initial prey population is 1,000 and initial predator population is 20. Example 1: Input: Enter the number of years: 50 Output: Prey population =12.30 Predator population =14.74 Example 2: Input: Enter the number of years: 10

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!