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
For the Address Block 195.200.0.0/16 a. If you have 320 Customers that need 128 addresses/customer - will there be enough addres
Shkiper50 [21]

Answer / Explanation:

195.200.0.0/16

Note: Class C address can not be assigned a subnet mask of /16 because class c address has 24 bits assigned for network part.

2ⁿ = number of subnets

where n is additional bits borrowed from the host portion.

2ˣ - 2 = number of hosts

where x represent bits for the host portion.

Assuming we have 195.200.0.0/25

In the last octet, we have one bit for the network

number of subnets  = 2¹  =2 network addresses  

number of host = 2⁷ - 2= 126 network addresses per subnets

8 0
3 years ago
System memory is on a computer motherboard?
Leya [2.2K]
Is this a true or fales question

8 0
3 years ago
Read 2 more answers
If you configure any more passwords on the switch, will they be displayed in the configuration file as plain text or in encrypte
Elza [17]

Answer:

The "service password-encryption" global configuration command encrypts passwords configured before and after the command is issued.

Explanation:

A switch is an intermediate network device that is used to transfer frames to nodes on its collision domain. It operates in the Data-link layer of the OSI model.

Switches uses media address control (MAC) table, containing the MAC addresses of the nodes in the network, to determine the destination of nodes.

In the global configuration mode in a switch, the password and other protocols are configured. The service password-encryption command in the global execution mode encrypts passwords configured before and after the command.

4 0
3 years ago
A photograph is taken by letting light fall on a light-sensitive medium, which then records the image onto that medium.
Andru [333]
True. At least that's how it is for camera's that print photos. Not digital cameras
4 0
3 years ago
Read 2 more answers
How is AI used in racing ?
NikAS [45]
This now allows human pilots to race together with AI drivers. The AI driver is, in this case, the intelligent software that gathers all data from the sensors and other touchpoints to drive the car.
3 0
3 years ago
Other questions:
  • To display or distribute information from a database, programmers or database administrators create ___ .
    12·1 answer
  • Which type of attack modifies the fields that contain the different characteristics of the data that is being transmitted?
    7·1 answer
  • How can improving one’s reasoning skills also improve one’s performance on the job?
    12·2 answers
  • Who invented the ENIAC? More than one answer may apply.
    14·1 answer
  • A collection of computers and other hardware devices that are connected together to share hardware, software, and data, as well
    15·1 answer
  • The MAA is responsible on a daily basis to protect office computers and patient records and personal information from hackers. R
    12·1 answer
  • Devices which are used to receive data from central processing unit are classified as
    11·1 answer
  • I will mark brainliest
    9·1 answer
  • Define the missing function. licenseNum is created as: (100000 * customID) licenseYear, where customID is a function parameter.
    12·1 answer
  • Where would you go to access frequently used icons?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!