help with c++ programming project 3

I ONLY NEED HELP WITH THE PROGRAMING WHICH IS PART 3 IN THE FILE ATTACHED..

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

using microsoft visual studio 2010 to implement the progam..

program requirement:

  • Your program must include a recursive function that computes xn for a given value of n. If the value for xn becomes > 1, then you can assume that the population will exceed continue to exceed the population capacity and should terminate subsequent computations. 
  • Your program must include a function that asks the use to specify a value for r , a value for x0, and a number of generations, n. 
  • Your program needs to calculate the results for your initial parameters and place the output in a tab delimited text file. This file should also contain information about the initial conditions of the model. 

CS151 – Fall 2012

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Programming Project 3

Population Models

In chapter 14, we learned about recursion and how it can be used to solve several different types

of problems and to compute the values of functions. One application area of recursion is in

creating population models. One of the earliest examples of a population model is the Fibonacci

numbers
1
, which were first described in the Western canon by Leonardo Pisano (a.k.a.

Fibonacci) in 1202
2
. The Fibonacci numbers use a recursive formula where the nth Fibonacci

number F(n) is given by the formula:

F(n) = F(n-1) + F(n-2) where F(1) = 1 and F(2) = 1

Fibonacci used these numbers to describe the unbounded growth of a rabbit population, but they

can also describe other naturally occurring phenomena such as the spirals on a pine cone
3
.

While Fibonacci numbers serve as a simple elegant model for population growth, they do not

account for an upper bound on population capacity. Several later models have taken this into

account. In this assignment, we will investigate the logistic model. Peirre Francois Verhulst

created the logistic model as a demographic model for population growth. Like the Fibonacci

Numbers, the logistic map shows how populations grow over time, but unlike earlier models it

also shows how populations can decline and die.

The logistic model is given by the equation:

xn+1 = r * xn (1 – xn) where

 xn is a number between zero and one and represents the population capacity at year n.

 x0 represents the initial population.

 r is a positive number that represents the combined rate for reproduction and starvation.

In this assignment, you will create a program in C++ to model the logistic function. Your

program needs to conform to the following criteria:

 Your program must include a recursive function that computes xn for a given value of
n. If the value for xn becomes > 1, then you can assume that the population will exceed

continue to exceed the population capacity and should terminate subsequent

computations.

 Your program must include a function that asks the use to specify a value for r , a value
for x0, and a number of generations, n.

 Your program needs to calculate the results for your initial parameters and place the
output in a tab delimited text file. This file should also contain information about the

initial conditions of the model.

1
We explored Fibonacci numbers in one of your lab 4’s.

2
These were previously studied by the Indian mathematicians Gopala and Hemachandra in 1150. See “Crest of the

Peacock” for a discussion of non-European origins of mathematics.
3
If you are interested in Fibonacci numbers, be sure to look at the Fibonacci Association.

http://www.mscs.dal.ca/Fibonacci/

Base Assignment (To Turn In)

This assignment will be delivered in four parts that correspond to the general program

development process.

Part 1 – Understand the Problem (10 Points) – Due October 15, 2012

Calculate 5 generations of the logistic model for these initial values.

1. r=0.2, x0 = 0.3
2. r=3.8, x0 = 0.2
3. r = 4.5, x0 = 0.8

You may use a calculator or Excel spreadsheet to perform these calculations. Post your answers

under the Laulima assignment link for program 3 – part 1.

Part 2 – Program Plan and Design (20 Points) – October 15, 2012

The first part of the assignment is your program plan and is due at the beginning of class on

October 15, 2012.

Your program plan should consist of the following items.

1. A description of your program design that indicates how you will design your program to
meet the assignment requirements. You should indicate:

a. The variables that your program will use and how you will name and use them.
b. The major functions your program will have along with descriptions of their

parameters.

c. Descriptions of the algorithms your program will use.
Note: You may want to try to take a system wide view of the design and show how all

the components relate to one another. Don’t be afraid to use visual representations and

diagrams.

2. Your program design description should also indicate how your solution will be easily
understood by the user and by future coders.

3. A brief set of test plans. Here, you should indicate what type of test cases you will run for
your program, the expected results of the test, what potential errors these test plans are

likely to trap, and a place for the test results. For example, you may want a test that

checks to see whether the program prevents you from giving a negative initial population.

To make it easy to present, consider making your plan in a PowerPoint format.

Part 3 – Create Your Program (40 Points) – Due October 22, 2012

Your program code (40 Points): Your code should have appropriate comments to explain the

program and the code. It should be written in a consistent and readable form and compile without

errors or warnings. It will also need to use a recursive implementation of the logistic function.

Submit this part using the Laulima assignment link for parts 3 and 4.

Part 4 – Test and Analyze (30 Points) – Due October 22, 2012

Proivde an explanation for the behavior of this function (30 Points): Here, you should run

your program with several different parameters for x0, and r.
4
You should run at least 10

experiments for this part of the question. Answer the following questions as part of this portion

of the assignment:

1) What are the types of behaviors can the function exhibit?

2) Which parameter has the greatest impact on the behavior of the function?

3) What are the values of the parameter from question 2 where the function changes its behavior?

4) What do the graphs look like? Since we are not using the visual capabilities of Visual Studio,

import your tab delimited text files into Microsoft Excel and use the graph wizard to visualize

your results.

Submit this part using the Laulima assignment link for parts 3 and 4.

Bonus (1 Point)

What is the term for the idea that small variations in the initial conditions of a dynamical system

produce large variations in the long term behavior of the system?

Project due date: October 22, 2012

4
You may want to keep n at some value less than 25 to avoid crashing the computer if you have implemented this as

pure recursion.

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER