1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alina1380 [7]
4 years ago
6

Write a program that prompts the user for the initial population sizes, these rates, and the number of years. Then print the pop

ulations for the given number of years after your simulation has completed. Hint: This can be accomplished in about 15 lines of code.
Computers and Technology
1 answer:
Genrish500 [490]4 years ago
3 0

Answer:

The solution code is written in Python:

  1. pop_size = int(input("Enter population size: "))
  2. growth_rate = float(input("Enter growth rate: "))
  3. years = int(input("Enter number of year: "))
  4. for n in range(1, years + 1):
  5.    pop_size = pop_size + (pop_size * growth_rate / 100)  
  6.    print("Population size after year " + str(n) + ": " + str(pop_size))

Explanation:

Firstly, prompt user to input initial population size, growth rate and number of years and assign them to their respective variables (Line 1 - 3).

Next, create a for-loop to iterate through the number from 1 till the given number of year (Line 5)

Within the for-loop, apply the formula

initial population + (initial population * growth rate )

to estimate the population size after n year (Line 6) and display the output (Line 7).

You might be interested in
Why is it a good idea to view your HTML code in more than one web browser
Mandarinka [93]

Because some features may not be available on some browsers. By viewing it on different browsers, we can see if there's any incompatibilities and fix them.

5 0
4 years ago
Okay I need help. In the first picture, the black glasses, that was my vision last year 52:17 135 and my vision now is 52:15 135
Aleksandr-060686 [28]
Bbetter I think glasses are better this year but also the dates. your eyes over tim adjust to things like glasses to help see so when yu got better glasses it got better
3 0
3 years ago
How do I type over Images (photo posted ​
Ber [7]
Oh a document, I do not believe that you have type on images, but if you were to type a text in a app called PicsArt and saved it and then put it onto the document over the picture it would work.
3 0
3 years ago
Read 2 more answers
What does this loop that uses a range function do? for i in range(7, 15): print("goodbye") It prints "goodbye" 8 times, numbered
goldfiish [28.3K]

Answer:

It prints "goodbye" 8 times.

Explanation:

The loop being described in this scenario would print "goodbye" 8 times. It would not include numbers detailing the range since the loop instructions only state for the system to print("goodbye") and nothing else. Also, it would only print it 8 times because in a range the endpoint is not included, this is mainly because in programming data structures tend to run on 0-based indexing.

6 0
3 years ago
Read 2 more answers
List the difference between sdram and dram​
IRISSAK [1]

Answer:

i need this for a challenge

Explanation:

4 0
3 years ago
Other questions:
  • Numeric data is stored in ___________ for direct processing.
    10·2 answers
  • If you wanted to make certain numbers in a spreadsheet stand out, you should _____.
    11·2 answers
  • _______ computing refers to applications and services that run on a distributed network using virtualized resources.
    14·1 answer
  • What are the basic tools for coding HTML manually?
    10·2 answers
  • How did the invention of the printing press lead eventually to an increase in the diversity of religious expression?
    7·1 answer
  • Write a program using nested loop to produce the following output:
    6·1 answer
  • You open the home page for www.alpineskihouse. On the home page, you see a link for the weather report. You want to view the wea
    6·1 answer
  • Wired network are the most reliable and provide the highest speed?
    7·1 answer
  • Linda is viewing the campaign report in her Google Ads account after successfully implementing conversion tracking tags for her
    7·1 answer
  • What does it mean when someone silences notifications?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!