Your program will prompt the user for the following information: current population number of yearly births from the previous year number of yearly deaths from the previous year number of years into the future for your predictive value of the future population. You will then compute the following: birth rate death rate growth rate the predicted future population Assignment Notes: To allow the user to input the numeric data (such as current population) it is necessary to use the input function. The input function takes a string in parenthesis that prompts the user what to enter. The computer then waits until the user types a response, terminated by the user typing the Enter key. A string, as a sequence of characters, is returned to the variable on the lefthand side of the assignment statement. For example: currPopulation = input(“Enter the current US population”) The data in currPopulation is a string (because that is what the input statement does) but we need it to be a number so we can use it in mathematical operations. Therefore, the above statement needs to tell the computer that a different type of data needs to be put into currPopulation. So we write: currPopuplation = int(input(“Enter the current US population”).) # The int converts the string entered to a number. Once converted to a number, the mathematical operations can be performed. For the final output, you need to typecast the resulting population to an int so you do not get a fraction of a person. Sample run/output: Enter current population250000 Enter the number of births in the previous year12000 Enter the number of deaths in the previous year10000 How many years into the future to predict population87 The predicted population would be 500041
Your
current population
number of yearly births from the previous year
number of yearly deaths from the previous year
number of years into the future for your predictive value of the future population.
You will then compute the following:
birth rate
death rate
growth rate
the predicted future population
Assignment Notes:
To allow the user to input the numeric data (such as current population) it is necessary to use the input function. The input function takes a string in parenthesis that prompts the user what to enter. The computer then waits until the user types a response, terminated by the user typing the Enter key. A string, as a sequence of characters, is returned to the variable on the lefthand side of the assignment statement. For example:
currPopulation = input(“Enter the current US population”)
The data in currPopulation is a string (because that is what the input statement does) but we need it to be a number so we can use it in mathematical operations. Therefore, the above statement needs to tell the computer that a different type of data needs to be put into currPopulation. So we write:
currPopuplation = int(input(“Enter the current US population”).)
# The int converts the string entered to a number.
Once converted to a number, the mathematical operations can be performed.
For the final output, you need to typecast the resulting population to an int so you do not get a fraction of a person.
Sample run/output:
Enter current population250000
Enter the number of births in the previous year12000
Enter the number of deaths in the previous year10000
How many years into the future to predict population87
The predicted population would be 500041

1) Below is python program to prompt the user for population, birth death and years to predict population, calculates birth death and growth rate and predicted future population
- It ask user to enter population, birth death and years to predict population
- Calculates birth death and growth rate
- Use for loop for number of years to predict future population
- Display predicted future population
2) Save program in python file and run
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images









