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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

 

 

 

Expert Solution
Explanation

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

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY