Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A local biologist needs a program to predict population growth. the inputs would

ID: 3630976 • Letter: A

Question

A local biologist needs a program to predict population growth. the inputs would the initial number of organisms, the rate of growth ( a real number greater than 0), the number of hours it takes to achieve this rate and a number of hours during which the population grows .

Explanation / Answer

def predict_population(): import math sp = input("What is the starting population? ") r = input("What is the rate of population growth (between 0 and 1)? ") while r > 1 or r < 0: print "Invalid population growth rate." r = input("Please enter a valid rate: ") t = input("How many years to predict? ") for i in range(t): tp = sp * math.exp(r*i) print "The population after",i,"years will be",tp predict_population()
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote