5.11: Population Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. A loop should display the size of the population for each day.

1 answer
Question:

5.11: Population Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. A loop should display the size of the population for each day.

Answers

Answer:// using c++ language#include "stdafx.h"; #include <iostream> #include<cmath> using namespace std; //startint main() {   //Declaration of variables in the program   double start_organisms;   double daily_increase;   int days;   double updated_organisms;   //The user enters the number of organisms as desired   cout << "Enter the starting number of organisms: ";   cin >> start_organisms;   //Validating input data   while (start_organisms < 2)   {       cout << "The starting number of organisms must be at least 2.\n";       cout << "Enter the starting number of organisms: ";       cin >> start_organisms;   }   //The user enters daily input, here's where we apply the 5.2% given in question   cout << "Enter the daily population increase: ";   cin>> daily_increase;   //Validating the increase   while (daily_increase < 0)   {       cout << "The average daily population increase must be a positive value.\n ";       cout << "Enter the daily population increase: ";       cin >> daily_increase;   }   //The user enters number of days   cout << "Enter the number of days: ";   cin >> days;   //Validating the number of days   while (days<1)   {       cout << "The number of days must be at least 1.\n";       cout << "Enter the number of days: ";       cin >> days;   }     //Final calculation and display of results based on formulas   for (int i = 0; i < days; i++)   {       updated_organisms = start_organisms + (daily_increase*start_organisms);       cout << "On day " << i + 1 << " the population size was " << round(updated_organisms)<<"."<<"\n";             start_organisms = updated_organisms;   }   system("pause");    return 0; //end}

Similar Solved Questions

2 answers

Can Someone solve this please I need This answer as soon as possible

Can Someone solve this please I need This answer as soon as possible...
2 answers

A young boy constantly tricks the people in his town into believing a wolf is attacking him and his flock of sheep. When a wolf actually attacks the boy, the townspeople don't believe him and refuse to help. The boy learns a valuable lesson about the dangers of lying. What literary form is this story an example of? A. A flashback B. An allusion C. An allegory D. A myth

A young boy constantly tricks the people in his town into believing a wolf is attacking him and his flock of sheep. When a wolf actually attacks the boy, the townspeople don't believe him and refuse to help. The boy learns a valuable lesson about the dangers of lying. What literary form is this stor...
1 answer

This is due tomorrow and I need step for step for the question 1 and 3

This is due tomorrow and I need step for step for the question 1 and 3...
1 answer

Which expression is equivalent to Assume x Greater-than 0.[tex]\sqrt{x} 8/6x[/tex]

Which expression is equivalent to Assume x Greater-than 0.[tex]\sqrt{x} 8/6x[/tex]...
2 answers

How did African-Americans help the North win the Civil War?

How did African-Americans help the North win the Civil War?...
1 answer

The celebration of st. patrick's day is an example of _______.

The celebration of st. patrick's day is an example of _______....
2 answers

Which answer best explains how Florida became a U.S. territory?

Which answer best explains how Florida became a U.S. territory?...
2 answers

Does (2,-3) satisfies the equation 5x+3y=1

Does (2,-3) satisfies the equation 5x+3y=1...
1 answer

Please Help Me Please English

Please Help Me Please English...
1 answer

Pls help! You are buying a fence to enclose a garden that has an area of 315 square feet.​

Pls help! You are buying a fence to enclose a garden that has an area of 315 square feet.​...
1 answer

Plz help me with this

Plz help me with this...
1 answer

¡Ahora, hazlo tú!1.Construye en tu cuaderno una circunferencia de:a.2 cm de radio y halla su longitud.b. 3 cm de radio y halla su longitud.C.4 cm de radio y halla su longitud.d.10 cm de diámetro y halla su longitud.e.12 cm de diámetro y halla su longitud.​

¡Ahora, hazlo tú!1.Construye en tu cuaderno una circunferencia de:a.2 cm de radio y halla su longitud.b. 3 cm de radio y halla su longitud.C.4 cm de radio y halla su longitud.d.10 cm de diámetro y halla su longitud.e.12 cm de diámetro y halla su longitud.​...
2 answers

What is the stressed syllable in the word “protest”? Is it pro or test?

What is the stressed syllable in the word “protest”? Is it pro or test?...
1 answer

What factors caused the abolitionist movement the women’s suffrage movement and the 1960s civil rights movement to success

What factors caused the abolitionist movement the women’s suffrage movement and the 1960s civil rights movement to success...
1 answer

I need someone to explain to me this in steps how to solve this, please help. The price of a dozen cookies at a bake sale last year was $2. This year, the price for a dozen cookies was $5. What is the percent of change?

I need someone to explain to me this in steps how to solve this, please help. The price of a dozen cookies at a bake sale last year was $2. This year, the price for a dozen cookies was $5. What is the percent of change?...
1 answer

Order the various instruments used for measuring water in this experiment (balances, graduated cylinders, beaker and pipette) from the most accurate to the least accurate, Use sentence(s).

Order the various instruments used for measuring water in this experiment (balances, graduated cylinders, beaker and pipette) from the most accurate to the least accurate, Use sentence(s)....
1 answer

Wrote the localigation factor of industry​

wrote the localigation factor of industry​...
1 answer

Someone please help me on this question ?:)

someone please help me on this question ?:)...

-- 0.044001--