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]
3 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]3 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
. What process skill would a scientist use to find the length of a line
Brilliant_brown [7]

Answer:

Explanation:

A ruler

;););););););););););););););)

7 0
3 years ago
Explain the concept of an engineering trade-offs and give an example
makvit [3.9K]

ytfjkhm,MNbkvjhmb,kn.l">

k

8 0
3 years ago
Read 2 more answers
The faster the film (the higher the ISO), the more visible its grain. When you are using higher ISO, you are not just bringing g
NikAS [45]
I could not tell you
3 0
3 years ago
Read 2 more answers
Contrast the following terms (provide examples): Partial dependency; transitive dependency
kiruha [24]

Answer:

Explanation:

Transitive dependency

In this case, we have three fields, where field 2 depends on field 1, and field three depends on field 2.

For example:

Date of birth --> age --> vote

Partial dependency

It is a partial functional dependency if the removal of any attribute Y from X, and the dependency always is valid

For example:

Course and student these tables have a partial dependency, but if we have the field registration date, this date will depend on the course and student completely, we must create another table with the field registration date to remove this complete dependency.

If we remove or update the table registration date, neither course nor student must not change.

5 0
3 years ago
A user from the financial aid office is having trouble interacting with the finaid directory on the university's ERP system. The
Harlamova29_29 [7]

Answer:

A. The permissions on the finaid directory should be drwxrwxrwx.

Explanation:

The financial aid system is developed to record the fund inflow and outflows. The ERP system of the university has finaid system on which commands are run and output is received. The permissions on the finaid directory should be drwxr to enable the users to run the commands.

5 0
2 years ago
Other questions:
  • Which of the following is an example of a logic bug?
    8·1 answer
  • Which searching method requires that the list be sorted?
    5·1 answer
  • Largest of five (5 points). Write an algorithm that read 5 distinct integers and displays the largest value. Assume the input va
    14·1 answer
  • Pls help me
    5·1 answer
  • What are html documents also called?
    12·1 answer
  • Help me or I'll go insane I've 6x already I'm about to lose it!!!!
    11·2 answers
  • The 10 and 2 o'clock hand position on the steering wheel is no longer recommended because _____.
    13·1 answer
  • Can Someone help plz?
    11·1 answer
  • What is impact of Internet<br> in our lives
    7·1 answer
  • Which of these is a negative effect of computer technology's role in creating
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!