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
vfiekz [6]
3 years ago
8

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.
Input Validation.Do not accept a number less than 2 for the starting size of the population. If the user fails to satisfy this print a line with this message "The starting number of organisms must be at least 2.", display the prompt again and try to read the value. Similarly, do not accept a negative number for average daily population increase, using the message "The average daily population increase must be a positive value." and retrying. Finally, do not accept a number less than 1 for the number of days they will multiply and use the message "The number of days must be at least 1."
Computers and Technology
1 answer:
sineoko [7]3 years ago
6 0

Answer:

// using c++ language

#include "stdafx.h";

#include <iostream>

#include<cmath>

using namespace std;

//start

int 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

}

Explanation:

You might be interested in
What is the difference between a computer’s RAM and its hard disk?
san4es73 [151]

Answer:

D. RAM is volatile, which means that it must be handheld with care when removed or replaced. A hard disk is not volatile, which means that it is much more resistant to movement during removal or replacement.

Explanation:

Most RAM (random access memory) used for primary storage in personal computers is volatile memory. Volatile memory contrasts with non-volatile memory, which does not lose content when power is lost. Non-volatile memory has a continuous source of power and does not need to have its memory content periodically refreshed.

8 0
2 years ago
Read 2 more answers
Practice Home Survey
Ksivusya [100]

Answer:

Since this is a survey without preparation, you can move ahead as you like. However, still, you need to figure out the attributes. Here you need to register plugged in hours for each of your family members. And the same thing is abbreviated as screen time as well. You need to make a table with two columns, a family member's name, and the screen time or plugged in time. And you are not required to do anything else, as the survey is the method of collecting the data. And it does not deal with the analysis. The analysis will be done, when you will sit as an analyst. And in fact, you are making this impromptu survey for the family head, who is in charge of your family which can be your father or mother or your grand father or grand mother. And they can use these details for various findings, like how can they reduce cable TV cost per month, and so on. Your job is to collect the accurate data. And same thing, you need to repeat for all the survey that you are asked to conduct. Always remember, you need to know what data you need to collect through a survey. Plan for the survey only after finding the complete details about this. And even when asked to conduct as unprepared, this knowledge is essential.  

Explanation:

Please check the attachment.

5 0
4 years ago
Which feature of presentation software is located under the Insert tab?
blondinia [14]

Answer:

Shapes

Explanation:

7 0
3 years ago
Read 2 more answers
Please please help I don’t understand this
garik1379 [7]

Answer:

It is this because yass

Explanation:

And yes

6 0
3 years ago
Read 2 more answers
A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is
Aleks04 [339]
A technology cycle begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is replaced by a newer, substantially better technology.
5 0
4 years ago
Other questions:
  • In what year did commercial use of the Internet become available? 1991 1996 1999 2001
    9·1 answer
  • What does API stand for
    7·2 answers
  • Mike's boss told him he needs to be more efficient. Select each suggestion that will help him become more efficient at creating
    9·1 answer
  • Typical business cards in the U.S. are _____.
    5·1 answer
  • What is an important step to take before entering your first data into your database?
    10·2 answers
  • Suppose users share a 1 Mbps link. Also suppose each user
    10·1 answer
  • Which user characteristic may not be used to change keyword bids in adwords?:?
    11·1 answer
  • Why is it necessary to have usernames and passwords if one is working on a network?​
    12·1 answer
  • What is artificial Intelligence ?
    11·2 answers
  • FREEEEE 100 POINTS COME TAKE COME COME COME<br><br> only if u like da black panther
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!