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
Does trend in computing important for organization management?​
mario62 [17]

Answer:

yes it is...................

6 0
3 years ago
A continuous and differentiable function f(x) with the following properties: f(x) is decreasing at x=−5 f(x) has a local minimum
butalik [34]

The continuous and differentiable function where f(x) is decreasing at x = −5 f(x) has a local minimum at x = −2 f(x) has a local maximum at x = 2 is given as: y = 9x - (1/3)x³ + 3.

<h3>What is a continuous and differentiable function?</h3>

The continuous function differs from the differentiable function in that the curve obtained is a single unbroken curve in the continuous function.

In contrast, if a function has a derivative, it is said to be differentiable.

<h3>What is the solution to the problem above?</h3>

It is important to note that a function is differentiable when x is set to a if the function is continuous when x = a.

Given the parameters, we state that

f'(5) < 0; and

x = -5

The local minimum is given as:
x = -3;

the local maximum is given as

x = 3

Thus, x = -3 ; alternatively,

x = 3.  With this scenario, we can equate both to zero.

Hence,

x + 3 = 0;

3-x = 0.

To get y' we must multiply both equations to get:

y' = (3-x)(x + 3)

y'   = 3x + 9 - x² - 3x

Collect like terms to derive:

y' = 3x - 3x + 9 - x²; thus

y' = 9-x²

When y' is integrated, the result is

y = 9x - (x³/3) + c

Recall that

F (-5) < 0

This means that:

9 x -5 - (-5³/3) + c < 0
⇒ -45 + 125/3 + c <0
⇒ -10/3 + c < 0

Collecting like terms we have:
c < 10/3; and

c < 3.33


Substituting C into

f(x) = 9x - x³/3 + c; we have

f(x) = 9x - x³/3 + 3, which is the same as  y = 9x - (1/3)x³ + 3.

Learn more about differentiable functions at:
brainly.com/question/15047295
#SPJ1

7 0
2 years ago
What is a correlation and how does it relate to inferential error?
riadik2000 [5.3K]
A correlation is a consistent relationship between two or more variables. It relates to our tendency to draw causation from mere correlation.
5 0
3 years ago
comparing the cost of care provided to medicare beneficiaries assigned to primary care nurse practitioners and physicians
Aleks [24]

"Comparing the cost of care provided to Medicare beneficiaries assigned to primary care nurse practitioners and physicians" is a study that

<h3>What is the cost of Medicare according to the above study?</h3>

The study shows that after controlling for demographics, geography, comorbidities, and proclivity to visit an NP, Medicare evaluation and management payments for patients allocated to an NP were $207, or 29%, less than PCMD assigned beneficiaries.

The similar tendency was seen for inpatient and total office visit payment amounts, with NP-assigned beneficiaries receiving 11 and 18 percent less, respectively. The work component of relative value units yields similar results.

Learn more about Medicare:
brainly.com/question/1960701
#SPJ4

8 0
1 year ago
Trucking A. is one of the least flexible transportation modes. B. is increasingly using computers to manage its operations. C. i
saw5 [17]

Answer:

B. is increasingly using computers to manage its operations.

Explanation:

Trucking -

It refers to the practice of using computer for the management purpose , is referred to as the process of trucking .

The method is very useful for the business and companies in order to adapt a faster and efficient mode of management .

Hence , from the given information of the question ,

The correct option is b. is increasingly using computers to manage its operations.

7 0
3 years ago
Other questions:
  • Consider the pseudo-cpu discussed in class. the instruction format is 16 bits, which is subdivided into 4-bit opcode field and 1
    14·1 answer
  • How do you change the slide layout?
    6·2 answers
  • How did the invention of the printing press lead eventually to an increase in the diversity of religious expression?
    7·1 answer
  • Which of the following correctly describes the function of an IP address
    13·1 answer
  • Can anyone please help with this programming code in python num= 7 if num &gt; 3: print(“3”) if num &lt; 5: print(“5”) if num ==
    6·1 answer
  • Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
    13·1 answer
  • Technology trends in education play a key role in a student’s
    15·1 answer
  • The identification of the technology management framework contain?
    6·1 answer
  • What is assembler? What is Compiler?What is interpreter?
    9·2 answers
  • What what do these two parts of the lift do ​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!