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
Xelga [282]
4 years ago
6

Write a program that will predict the size of a population of organisms. The program // should ask the user for the starting num

ber of organisms, their average daily population // increase (as a percentage of the current population), and the number of days they will // multiply. A loop should display the size of the population for each day.
Computers and Technology
1 answer:
nordsb [41]4 years ago
7 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream>

using namespace std;

int main() {

 float starting, average;

 int num;

 std::cout <<"Enter starting number of the organisms: ";

 while(!(std::cin >> starting)|| starting < 2){

   std::cout<<"starting number must be greater than 2\n";

   std::cout <<"Enter starting number of the organisms: ";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

 std::cout <<"Enter the average of daily population is increase %: ";

 while(!(std::cin >> average)|| average < 0){

   std::cout<<"Average must be greater than 0\n Enter average";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

   average *= .01;

 std::cout <<"Enter the number of days: ";

 while(!(std::cin >> num)|| num < 1){

   std::cout<<"Number of days no be less than 1\n" <<"Enterthe number of days\n";

   std::cin.clear();

   std::cin.ignore(123,'\n');

 }

 for(int i=0; i<num; i++){

   std::cout<<"population size of day"<<(i+1);

   std::cout<<": "<<starting<<std::endl;

   starting +=(starting*average);

 }

 return 0;

}

<u>Output</u>:

Enter starting number of the organisms: 4

Enter the average of daily population is increase %: 5

Enter the number of days: 4

population size of day1: 4

population size of day2: 4.2

population size of day3: 4.41

population size of day4: 4.6305

Explanation:

Here, we define header file "<iostream>" and namespace "std".

  • Then, we define the main() inside it, we set two float data type variable i.e., "starting", "average" and set an integer data type variable i.e., "num".
  • Then, we print a message and after that, we set the while loop for get input from the user in variable "starting" and pass the condition inside loop we print message than clear cin and ignore 123 then, we again do this to get  input from user in variable "average".
  • Then, we set the for loop and pass the condition inside the loop print the size of the day then print the value of "starting" after that we multiply.
  • Finally, we return 0 and close the main function.
You might be interested in
Using a WHILE loop write a program that asks the user to guess your favorite number. The program should end when the user guesse
eduard

Answer:

fav_number=26

guess=0

while 0==0:

   try:

       guess=int(input('Enter your guess: '))

   except:

       print ('You have entered an invalid value.')

   else:

       if guess == fav_number:

           break

       elif guess>fav_number:

            print ('Try a smaller number.')

       elif guess<fav_number:

           print ('Try a larger number')

Explanation:

define a variable fav_number and set it to number. write an infinite while loop to read input from user. In try block get input from user, if user enters invalid input code in except block will be executed. For valid input

  1. check if its greater than favorite number, if yes print try smaller number.
  2. check if its smaller than favorite number, if yes print try larger number.
  3. check if its equal to favorite number, break loop and exit

4 0
4 years ago
​___________, such as smart phones and social​ media, fundamentally change the nature of an industry and can be influential enou
svlad2 [7]

Answer:

Disruptive Technologies.

Explanation:

Smart Phones and the social media are very power tools they can be used to spread a news like a fire very rapidly.

People mostly believe the new that come on their smartphones and the social media.

So the employees of the company can also be influenced by these technologies hence they can disrupt the work of the company and can make or break the company.

6 0
4 years ago
Why are abbreviations like BRB, TBH, and IDK appropriate in some situations but not in others?
Y_Kistochka [10]

Dont talk in abbreviations to elders, most of them might not know what that means and youll likely have to teach them

7 0
3 years ago
Read 2 more answers
paula needs to ensure that an animation she has created is repeated. which option should she use to achieve this ?
Masteriza [31]

Answer:

transitions tab

Explanation:

please mark brainliest

4 0
3 years ago
A __________network is useful for connecting a small network.
Ket [755]
Guessing - local area network (LAN)
6 0
4 years ago
Read 2 more answers
Other questions:
  • What are some innovations that a cell phone has undergone since its original invention?
    14·1 answer
  • Side mirror using convex mirror or concave mirror?​
    5·2 answers
  • Ryan wants to ensure that all the words in this document are evenly spaced so that they look neat and readable . Which option in
    12·1 answer
  • To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu. Keep Source For
    12·2 answers
  • How to find determinant of ​
    15·1 answer
  • The Department of Homeland Security only deals with threats to national security and does not play a role in helping companies m
    13·1 answer
  • This instrument records seismic waves on a roll of paper. The recording is called a(n) _____.
    8·1 answer
  • Manuel is recording a macro and made a mistake. What is the best option for addressing this situation? O Pause and rewind the ma
    11·2 answers
  • For a single CPU core system equipped wiith addditional hardware modes (besides user and kernel), choose those items that are ex
    7·1 answer
  • I need subscribers plz ​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!