Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program A new modeling idea has come to light in determining a very erratic growth rates of a new organism just recently detected. The

C++ program

A new modeling idea has come to light in determining a very erratic growth rates of a new organism just recently detected. The growth model you are to develop is very experimental and is quit wacky. You will use a flinky-blinky link list data structure for this implementation version. The following are the steps for the simulation model for this wacky growth rate.

Step 1: Initialize the link list with 15 weeks of growth where each node will represent the number of organism each week as a Fibonacci sequence starting with the value of 2 for the first two weeks. (ie the first two values in the array will have the value of 2). You will generate the next 13 weeks by adding the previous two values to get the next weeks value. The growth rate is stable for the first 15 weeks. After the 15 weeks, the organism start showing some erratic growth properties (deaths). They either become too populated (crowded), get hunger and eat each other, some disease hits them (virus), other something else that disrupts the stable growth rate model not known at this time. After the 15th week:

Step 2: You will randomly select a previous week to be altered. The previous (week) you will select will be a random week from one of the previous 4 weeks (1-4). We will refer to the selected week as the NewEnd week. All values after NewEnd will be deleted. Step 3: After the NewEnd week selected in Step 2, its value (NewEnd) will be replaced with the 3rd week even further back in the array (3 weeks prior to NewEnd week). (a population reduction just took place and growth rate has a slow start in its growth rate model.)

Step 3: You will then start to regenerate the next 4 weeks of values as described in Step 1 (Fib 2). The growth rate is stable for the next four weeks.

Step 4: Go to Step 2 and repeat.

INPUT: Generated input from your programming efforts.

OUTPUT: You will print out the link list (all the weeks) along with the random number indicating the previous node (NewEnd) to be altered each time through the loop. Every 4-week period is one iteration. Print out the link list prior to altering the NewEnds value which shows the history growth values. Show how many of these organisms are present for the next 15 (4-week) iterations. Do this for the next 15 iterations, replacing the NewEnd value 15 times (if it doesnt become too big??). Note: if you generate the previous week that is prior to the first week, then use the first week value for replacement of NewEnds value. (Dont go beyond the first node.)

Example: Initial weeks: (note: these are biological (my brain) random numbers shown here) 2 2 4 6 10 16 26 42 68 110 178 288 466 754 1220 random #: 3 (EndNode is 288) Replacing 288 with the 3rd week back (68) you get the next array as output and the next 4 weeks of growth. Iteration 1; 2 2 4 6 10 16 26 42 68 110 178 68 (new value) 246 314 560 874 random #: 1 (EndNode 560) Iteration 2: 2 2 4 6 10 16 26 42 68 110 178 68 246 314 68 (new value) 382 450 832 1282 random #: 5 (EndNode 314) Iteration 3: 2 2 4 6 10 16 26 42 68 110 178 68 246 178 (new value) 424 612 1036 1448

Note: You are using a forward-backboard Link List. You will use the backward link to handle previous week values as needed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

What is a problem statement, and what function does it serve?

Answered: 1 week ago